61 const Eigen::Matrix<Scalar,Eigen::Dynamic,Eigen::Dynamic>& C,
62 const Eigen::Matrix<Scalar,Eigen::Dynamic,1>& d,
63 const Scalar& small_number,
64 std::vector<VariableDomain>& domains,
65 std::string& halt_reason
95 const std::vector<VariableDomain>& domains
115template<
class Scalar>
117 const Eigen::Matrix<Scalar,Eigen::Dynamic,Eigen::Dynamic>& C,
118 const Eigen::Matrix<Scalar,Eigen::Dynamic,1>& d,
119 const Scalar& small_number,
120 Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>& T,
121 std::string& halt_reason
175template<
class Scalar>
177 const Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>& C,
178 const Eigen::Matrix<Scalar, Eigen::Dynamic, 1>& d,
179 Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>& tableau,
180 std::vector<int>& basic_variables
196template<
class Scalar>
198 Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>& tableau,
199 const std::vector<int>& basic_variables
229template<
class Scalar>
231 Eigen::Matrix<Scalar,Eigen::Dynamic,Eigen::Dynamic>& tableau,
232 int entering_variable,
274template<
class Scalar>
276 Eigen::Matrix<Scalar,Eigen::Dynamic,Eigen::Dynamic>& tableau,
277 std::vector<int>& basic_variables,
278 const Scalar& small_number,
279 std::string& halt_reason
321template<
class Scalar>
323 const Eigen::Matrix<Scalar,Eigen::Dynamic,1>& objective,
324 Eigen::Matrix<Scalar,Eigen::Dynamic,Eigen::Dynamic>& tableau,
325 std::vector<int>& basic_variables,
327 const Scalar& small_number,
328 std::string& halt_reason
365template<
class Scalar>
367 const Eigen::Matrix<Scalar,Eigen::Dynamic,1>& objective,
368 Eigen::Matrix<Scalar,Eigen::Dynamic,Eigen::Dynamic>& tableau,
369 std::vector<int>& basic_variables,
371 const Scalar& small_number,
372 const Scalar& large_number,
373 std::string& halt_reason
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > transformation_matrix_from_domains(const std::vector< VariableDomain > &domains)
Calculate a transformation matrix so that , .
void pivot(Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > &tableau, int entering_variable, int leaving_variable)
Perform a pivot operation between a basic and a non-basic variable.
bool deduce_variables_domains(const Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > &C, const Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > &d, const Scalar &small_number, std::vector< VariableDomain > &domains, std::string &halt_reason)
Given a set of inequality constraints, deduce the domain of the decision variables.
bool simplex(Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > &tableau, std::vector< int > &basic_variables, const Scalar &small_number, std::string &halt_reason)
Perform successive pivot operations until a termination condition is met.
bool transformation_matrix(const Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > &C, const Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > &d, const Scalar &small_number, Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > &T, std::string &halt_reason)
Calculate a transformation matrix so that , .
void create_tableau(const Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > &C, const Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > &d, Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > &tableau, std::vector< int > &basic_variables)
Create a Simplex Tableau given a set of inequality constraints.
bool two_steps_method(const Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > &objective, Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > &tableau, std::vector< int > &basic_variables, unsigned int na, const Scalar &small_number, std::string &halt_reason)
Solve a minimization problem using the two-steps Simplex method.
bool penalty_method(const Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > &objective, Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > &tableau, std::vector< int > &basic_variables, unsigned int na, const Scalar &small_number, const Scalar &large_number, std::string &halt_reason)
Solve a minimization problem using the penalty Simplex method.
void eliminate_objective(Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > &tableau, const std::vector< int > &basic_variables)
Use Gaussian elimination on the last row of the tableau.
Main namespace of this project, containing all utilities.
Auxiliay structure to store the domain of a variable.
bool non_positive
If true, .
bool non_negative
If true, .
int idx
Which constraint (if any) implies the given domain.