1 #ifndef LPINTERFACE_LPHANDLE_SOPLEX_H
2 #define LPINTERFACE_LPHANDLE_SOPLEX_H
6 #include <unordered_map>
11 #include "lpinterface/badge.hpp"
12 #include "lpinterface/detail/util.hpp"
22 std::shared_ptr<soplex::SoPlex> soplex)
24 std::iota(permutation_.begin(), permutation_.end(), 0);
25 inverse_permutation_ = detail::inverse_permutation(permutation_);
26 std::iota(permutation_vars_.begin(), permutation_vars_.end(), 0);
27 inverse_permutation_vars_ = detail::inverse_permutation(permutation_vars_);
32 std::vector<Variable>
variables()
const override;
34 void add_variables(
const std::vector<Variable>& vars)
override;
45 std::size_t
num_vars()
const override;
57 std::vector<Constraint<double>>
constraints()
const override;
66 std::vector<std::size_t> permutation_;
67 std::vector<std::size_t> inverse_permutation_;
69 std::vector<std::size_t> permutation_vars_;
70 std::vector<std::size_t> inverse_permutation_vars_;
72 std::shared_ptr<soplex::SoPlex> soplex_;
79 #endif // LPINTERFACE_LPHANDLE_SOPLEX_H
Struct to represent right-hand side of LP constraints. In linear programming, we have constraints of ...
Definition: data_objects.hpp:192
void set_objective(const Objective< double > &objective) override
Set the objective function to be used. This method must be called before calling add_constraints().
std::vector< Variable > variables() const override
Retrieve the variables from the internal LP solver.
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
std::size_t num_constraints() const override
Get the number of cosntraints in the LP.
Objective< double > objective() const override
Retrieve the objective function of the internal LP. This method requests the objective function value...
Minimize the objective function value.
Variable variable(std::size_t i) const override
Retrieve variable i from the internal LP solver.
std::size_t num_vars() const override
Get the number of variables in the LP.
Definition: lphandle_soplex.hpp:19
void add_variables(const std::vector< Variable > &vars) override
Add variables to the LP.
void set_objective_sense(const OptimizationType objsense) override
Set the objective sense of this ILinearProgramHandle. The Optimization type can be either Optimizatio...
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
std::vector< Constraint< double > > constraints() const override
Retrieve the constraints of the internal LP. This method requests the constraints from the internal L...
Constraint< double > constraint(std::size_t i) const override
Retrieve constraint i of the internal LP. This method requests a constraint from the internal LP solv...
void add_constraints(const std::vector< Constraint< double >> &constraints) override
Add a set of constraints to the LP formulation. This can only be called after calling set_objective()...
void remove_variable(const std::size_t i) override
Remove a variable from the LP.
void remove_constraint(std::size_t i) override
Remove a constraint from the LP.
OptimizationType optimization_type() const override
Retrieve the objective sense of this ILinearProgramHandle. The Optimization type can be either Optimi...