2 #ifndef LPINTERFACE_LP_H
3 #define LPINTERFACE_LP_H
8 #include "data_objects.hpp"
25 inline std::ostream& operator<<(std::ostream& os,
const OptimizationType ot) {
36 throw UnsupportedFeatureException();
66 virtual std::size_t
num_vars()
const = 0;
94 virtual std::vector<Variable>
variables()
const = 0;
101 virtual void add_variables(
const std::vector<Variable>& vars) = 0;
167 virtual std::vector<Constraint<double>>
constraints()
const = 0;
184 #endif // LPINTERFACE_LP_H
virtual std::vector< Constraint< double > > constraints() const =0
Retrieve the constraints of the internal LP. This method requests the constraints from the internal L...
Struct to represent right-hand side of LP constraints. In linear programming, we have constraints of ...
Definition: data_objects.hpp:192
OptimizationType
Objective sense for an LP.
Definition: lp.hpp:17
Interface representing linear program formulation. This interface represents linear programs of the f...
Definition: lp.hpp:53
virtual void set_objective_sense(const OptimizationType objsense)=0
Set the objective sense of this ILinearProgramHandle. The Optimization type can be either Optimizatio...
virtual std::size_t num_vars() const =0
Get the number of variables in the LP.
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 solv...
Minimize the objective function value.
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 Variable variable(std::size_t i) const =0
Retrieve variable i from the internal LP solver.
Maximize the objective function value.
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 Objective< double > objective() const =0
Retrieve the objective function of the internal LP. This method requests the objective function value...
Class representing a variable in the LP.
Definition: data_objects.hpp:253
Struct representing the objective vector. A linear program has the canonical form This structure rep...
Definition: data_objects.hpp:223
virtual std::vector< Variable > variables() const =0
Retrieve the variables from the internal LP solver.
virtual void add_variables(const std::vector< Variable > &vars)=0
Add variables to the LP.
virtual void remove_constraint(const std::size_t i)=0
Remove a constraint from the LP.
virtual std::size_t num_constraints() const =0
Get the number of cosntraints in the LP.
virtual OptimizationType optimization_type() const =0
Retrieve the objective sense of this ILinearProgramHandle. The Optimization type can be either Optimi...
virtual void remove_variable(const std::size_t i)=0
Remove a variable from the LP.