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...
|
|
| ILinearProgramHandle (const ILinearProgramHandle &)=default |
| |
|
| ILinearProgramHandle (ILinearProgramHandle &&)=default |
| |
|
ILinearProgramHandle & | operator= (const ILinearProgramHandle &)=default |
| |
|
ILinearProgramHandle & | operator= (ILinearProgramHandle &&)=default |
| |
|
virtual std::size_t | num_vars () const =0 |
| | Get the number of variables in the LP.
|
| |
|
virtual std::size_t | num_constraints () const =0 |
| | Get the number of cosntraints in the LP.
|
| |
|
virtual void | set_objective_sense (const OptimizationType objsense)=0 |
| | Set the objective sense of this ILinearProgramHandle. The Optimization type can be either OptimizationType::Minimize or OptimizationType::Maximize, which correspond to the LP formulations min c^T * x and max c^T * x, respectively.
|
| |
| virtual Variable | variable (std::size_t i) const =0 |
| | Retrieve variable i from the internal LP solver. More...
|
| |
| virtual std::vector< Variable > | variables () const =0 |
| | Retrieve the variables from the internal LP solver. More...
|
| |
| virtual void | add_variables (const std::vector< Variable > &vars)=0 |
| | Add variables to the LP. More...
|
| |
|
virtual void | add_variables (const std::size_t num_vars)=0 |
| | Add num_vars non-negative variables to the LP. To be called before settings the objective function.
|
| |
|
virtual void | add_constraints (const std::vector< Constraint< double >> &constraints)=0 |
| | Add a set of constraints to the LP formulation. This can only be called after calling set_objective().
|
| |
| virtual void | remove_constraint (const std::size_t i)=0 |
| | Remove a constraint from the LP. More...
|
| |
| virtual void | remove_variable (const std::size_t i)=0 |
| | Remove a variable from the LP. More...
|
| |
|
virtual OptimizationType | optimization_type () const =0 |
| | Retrieve the objective sense of this ILinearProgramHandle. The Optimization type can be either OptimizationType::Minimize or OptimizationType::Maximize, which correspond to the LP formulations min c^T * x and max c^T * x, respectively.
|
| |
|
virtual void | set_objective (const Objective< double > &objective)=0 |
| | Set the objective function to be used. This method must be called before calling add_constraints().
|
| |
| virtual Constraint< double > | constraint (std::size_t i) const =0 |
| | Retrieve constraint i of the internal LP. This method requests a constraint from the internal LP solver backend, copies it, and returns it. Since constraints have to be copied from the backend, this can be an expensive operation, and so should be used sparingly. More...
|
| |
virtual std::vector
< Constraint< double > > | constraints () const =0 |
| | Retrieve the constraints of the internal LP. This method requests the constraints from the internal LP solver backend, copies them, and returns them in a vector. Since the constraints have to be copied from the backend, this can be quite an expensive operation, and so should not be called in a loop. More...
|
| |
| virtual Objective< double > | objective () const =0 |
| | Retrieve the objective function of the internal LP. This method requests the objective function values from the LP backend, copies them, and returns them. Since the objective values have to be copied from the backend, this can be quite an expensive operation, and so should not be called in a loop. More...
|
| |
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.