lpinterface
 All Classes Namespaces Files Functions Variables Enumerations Enumerator
Classes | Enumerations | Functions | Variables
lpint Namespace Reference

Classes

class  MatrixEntry
 Matrix entry type, for use in sparse matrix. The matrix entry base class is specialized as Row and Column, for the two sparse matrix representations. The class thus represents a row or column vector with mostly zero entries. Its operator[] is overloaded to provide access as if it is a dense vector. Access using operator[] is O(n) in time, with n the number of nonzero entries. More...
 
class  Column
 
class  Row
 
struct  Constraint
 Struct to represent right-hand side of LP constraints. In linear programming, we have constraints of the form

\[ Ax <\mathrm{cmp}> b, \]

where $<cmp>$ represents an elementwise comparison operator, such as $\leq$. This struct represents one element of the right-hand side of such a constraint, together with the elementwise comparison. More...

 
struct  Objective
 Struct representing the objective vector. A linear program has the canonical form

\[ \max c^T x. \]

This structure represents the vector $c$. More...

 
class  Variable
 Class representing a variable in the LP. More...
 
struct  Solution
 Struct representing the solution of a linear program. More...
 
class  LpException
 Class for wrapping exception occurring in lpinterface. The linear program interface can return errors at many points, for various reasons. This exception classed is subclassed for each error cause, allowing fine-grained control over various error paths. More...
 
class  NotImplementedError
 Attempt to use a feature that is not yet implemented. More...
 
class  ModelNotSolvedException
 Attempt to access solution of an unsolved model. More...
 
class  UnsupportedParameterException
 Attempt set a parameter that is not supported by the current backend. More...
 
class  UnsupportedConstraintException
 
class  InvalidMatrixEntryException
 Attempt to add a matrix entry containing duplicate indices. More...
 
class  UnsupportedVariableTypeException
 Attempt to use a variable type that is not supported by the current backend. More...
 
class  InvalidVariableBoundsException
 Attempt to construct a variable with invalid bounds. More...
 
class  GurobiException
 Internal error occured in Gurobi. More...
 
class  UnknownStatusException
 Attempt to use a status code that is not supported. More...
 
class  UnsupportedFeatureException
 Attempt to use a feature that is not supported by the current backend. More...
 
class  FailedToSetParameterException
 Failed to set a parameter value. More...
 
class  SoplexException
 Internal error occured in SoPlex. More...
 
class  MismatchedDimensionsException
 
class  ILinearProgramHandle
 Interface representing linear program formulation. This interface represents linear programs of the form {min, max} c^T x, Ax <= b, x >= 0, where c, x, and b are real-valued vectors, and A is a real-valued matrix. The interface provides methods to modify the LP internally, as well access the LP structure. More...
 
class  LinearProgramSolver
 Interface to internal linear program solver. This interface is the most important interface within lpinterface. It allows one to generically use various different linear program solvers polymorphically. See the documentation of its methods and the implementations of this interface for usage information. More...
 
class  LinearProgramHandleGurobi
 
class  GurobiSolver
 
class  LinearProgramHandleSoplex
 
class  SoplexSolver
 

Enumerations

enum  Status : int {
  Status::NotLoaded, Status::NoInformation, Status::Optimal, Status::Infeasible,
  Status::InfeasibleOrUnbounded, Status::Unbounded, Status::Cutoff, Status::IterationLimit,
  Status::NodeLimit, Status::TimeOut, Status::SolutionLimit, Status::Interrupted,
  Status::NumericFailure, Status::SuboptimalSolution, Status::InProgress, Status::UserObjectiveLimit,
  Status::NoRatioTester, Status::NoPricer, Status::NoSolver, Status::ExitDecomposition,
  Status::Decomposition, Status::Cycling, Status::OptimalUnscaledViolations, Status::NotInitialized,
  Status::ObjectiveLimit, Status::Regular
}
 Enum class representing LP solution status. More...
 
enum  OptimizationType { OptimizationType::Minimize, OptimizationType::Maximize }
 Objective sense for an LP. More...
 
enum  Param {
  Param::Threads, Param::ObjectiveSense, Param::Cutoff, Param::Infinity,
  Param::TimeLimit, Param::ObjectiveLowerLimit, Param::ObjectiveUpperLimit, Param::Verbosity,
  Param::PrimalOrDual, Param::IterationLimit
}
 Enum class representing linear solver parameters. The linear solvers this library interfaces with have various parameters that are used internally. This enum class represents these parameters in a generic fashion. More...
 

Functions

template<class T >
bool operator== (const MatrixEntry< T > &left, const MatrixEntry< T > &right)
 
template<class T >
bool operator== (const Constraint< T > &left, const Constraint< T > &right)
 
template<class T >
bool operator== (const Objective< T > &left, const Objective< T > &right)
 
bool operator== (const Variable &left, const Variable &right)
 
std::ostream & operator<< (std::ostream &os, const Variable &var)
 
template<typename T >
std::ostream & operator<< (std::ostream &os, const Constraint< T > &constraint)
 
template<typename T >
std::ostream & operator<< (std::ostream &os, const Objective< T > &obj)
 
template<typename T >
std::ostream & operator<< (std::ostream &os, const MatrixEntry< T > &row)
 
std::ostream & operator<< (std::ostream &os, const Status &status)
 
std::ostream & operator<< (std::ostream &os, const OptimizationType ot)
 

Variables

constexpr double LPINT_INFINITY = std::numeric_limits<double>::infinity()
 Constant representing floating point infinity.
 
constexpr double DOUBLE_TOLERANCE = 1e-15
 

Detailed Description

Enumeration Type Documentation

Objective sense for an LP.

Enumerator
Minimize 

Maximize the objective function value.

Maximize 

Minimize the objective function value.

enum lpint::Param
strong

Enum class representing linear solver parameters. The linear solvers this library interfaces with have various parameters that are used internally. This enum class represents these parameters in a generic fashion.

Enumerator
Threads 

How many threads the solver should use. (Gurobi)

ObjectiveSense 

Whether to minimize or maximize the objective. (Gurobi, SoPlex)

Cutoff 

At what value the objective should be cut off. (SoPlex)

Infinity 

Infinity threshold. (SoPlex)

TimeLimit 

Time limit alotted to solution process. (Gurobi, SoPlex)

ObjectiveLowerLimit 

Lower limit of the objective function. (SoPlex)

ObjectiveUpperLimit 

Upper limit of the objective function. (SoPlex)

Verbosity 

Verbosity level. Lower is less verbose, minimum 0. (Gurobi, SoPlex)

PrimalOrDual 

Whether to solve the primal (0) or dual (1) LP. (Gurobi, SoPlex)

IterationLimit 

Maximum number of iterations for simplex algorithm. (Gurobi, SoPlex)

enum lpint::Status : int
strong

Enum class representing LP solution status.

Enumerator
NotLoaded 

No Linear Program has been loaded.

NoInformation 

Linear program loaded, but no solution information available.

Optimal 

Model was solved to optimality, solution available.

Infeasible 

Model was proven to be infeasible.

InfeasibleOrUnbounded 

Model was proven to be either infeasible or unbounded.

Unbounded 

Model was proven to be unbounded.

Cutoff 

Optimal objective for model was proven to be worse than the value specified in the Cutoff parameter.

IterationLimit 

Number of iterations exceeded user-specified iteration limit.

NodeLimit 

Total number of branch-and-cut nodes explored exceeded user-specified node limit.

TimeOut 

Time limit reached.

SolutionLimit 

Solutions found exceeded solution limit.

Interrupted 

Optimization interrupted by user.

NumericFailure 

Optimizer ran into unrecoverable numerical difficulties.

SuboptimalSolution 

Could not satisfy tolerances; sub-optimal solution is available.

InProgress 

Optimization is currently in progress.

UserObjectiveLimit 

User-specified objective limit has been reached.

NoRatioTester 

No ratiotester loaded (SoPlex).

NoPricer 

No pricer loaded (SoPlex).

NoSolver 

No solver loaded.

ExitDecomposition 

Solving process aborted to exit decomposition simplex (SoPlex).

Decomposition 

Solving process aborted due to commence decomposition simplex (SoPlex).

Cycling 

Solving process aborted due to presence of cycling.

OptimalUnscaledViolations 

Problem solved to optimality, but unscaled solution contains violations.

NotInitialized 

Equivalent to SoPlex NOT_INIT status.

ObjectiveLimit 

Solving process aborted as objective limit has been reached.

Regular 

LP has a usable basis (SoPlex).