|
EigenOpt 1.0.0
|
Contains functions to solve linear programming problems with the Simplex method. More...
Namespaces | |
| namespace | internal |
| Utility functions used by the Simplex algorithm. | |
Functions | |
| template<class Scalar , class D1 , class D2 , class D3 , class D4 , class D5 , class D6 > | |
| bool | minimize (const Eigen::MatrixBase< D1 > &f, const Eigen::MatrixBase< D2 > &A, const Eigen::MatrixBase< D3 > &b, const Eigen::MatrixBase< D4 > &C, const Eigen::MatrixBase< D5 > &d, Eigen::DenseBase< D6 > &x, std::string &halt_reason, const Scalar &small_number, const Scalar &large_number=-1) |
| Solve a constrained linear optimization problem. | |
| template<class Scalar , class D1 , class D2 , class D3 , class D4 > | |
| bool | minimize (const Eigen::DenseBase< D1 > &f, const Eigen::DenseBase< D2 > &C, const Eigen::DenseBase< D3 > &d, Eigen::DenseBase< D4 > &x, std::string &halt_reason, const Scalar &small_number, const Scalar &large_number=-1) |
| Solve an inequality-constrained linear optimization problem. | |
| template<class Scalar , class D1 , class D2 , class D3 , class D4 , class D5 , class D6 > | |
| bool | maximize (const Eigen::MatrixBase< D1 > &f, const Eigen::MatrixBase< D2 > &A, const Eigen::MatrixBase< D3 > &b, const Eigen::MatrixBase< D4 > &C, const Eigen::MatrixBase< D5 > &d, Eigen::DenseBase< D6 > &x, std::string &halt_reason, const Scalar &small_number, const Scalar &large_number=-1) |
| Solve a constrained linear optimization problem. | |
| template<class Scalar , class D1 , class D2 , class D3 , class D4 > | |
| bool | maximize (const Eigen::DenseBase< D1 > &f, const Eigen::DenseBase< D2 > &C, const Eigen::DenseBase< D3 > &d, Eigen::DenseBase< D4 > &x, std::string &halt_reason, const Scalar &small_number, const Scalar &large_number=-1) |
| Solve an inequality-constrained linear optimization problem. | |
Contains functions to solve linear programming problems with the Simplex method.
|
inline |
Solve an inequality-constrained linear optimization problem.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 161 of file simplex.hpp.
| bool EigenOpt::simplex::maximize | ( | const Eigen::MatrixBase< D1 > & | f, |
| const Eigen::MatrixBase< D2 > & | A, | ||
| const Eigen::MatrixBase< D3 > & | b, | ||
| const Eigen::MatrixBase< D4 > & | C, | ||
| const Eigen::MatrixBase< D5 > & | d, | ||
| Eigen::DenseBase< D6 > & | x, | ||
| std::string & | halt_reason, | ||
| const Scalar & | small_number, | ||
| const Scalar & | large_number = -1 |
||
| ) |
Solve a constrained linear optimization problem.
This function uses the Simplex method to solve the problem:
\begin{equation} \max_{\bm{x}} \bm{f}^T \bm{x} \quad\text{subject to:}\quad \begin{cases} \bm{A} \bm{x} = \bm{b} \\ \bm{C} \bm{x} \leq \bm{d} \end{cases} \end{equation}
Definition at line 140 of file simplex.hpp.
| bool EigenOpt::simplex::minimize | ( | const Eigen::DenseBase< D1 > & | f, |
| const Eigen::DenseBase< D2 > & | C, | ||
| const Eigen::DenseBase< D3 > & | d, | ||
| Eigen::DenseBase< D4 > & | x, | ||
| std::string & | halt_reason, | ||
| const Scalar & | small_number, | ||
| const Scalar & | large_number = -1 |
||
| ) |
Solve an inequality-constrained linear optimization problem.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 15 of file simplex.hxx.
| bool EigenOpt::simplex::minimize | ( | const Eigen::MatrixBase< D1 > & | f, |
| const Eigen::MatrixBase< D2 > & | A, | ||
| const Eigen::MatrixBase< D3 > & | b, | ||
| const Eigen::MatrixBase< D4 > & | C, | ||
| const Eigen::MatrixBase< D5 > & | d, | ||
| Eigen::DenseBase< D6 > & | x, | ||
| std::string & | halt_reason, | ||
| const Scalar & | small_number, | ||
| const Scalar & | large_number = -1 |
||
| ) |
Solve a constrained linear optimization problem.
This function uses the Simplex method to solve the problem:
\begin{equation} \min_{\bm{x}} \bm{f}^T \bm{x} \quad\text{subject to:}\quad \begin{cases} \bm{A} \bm{x} = \bm{b} \\ \bm{C} \bm{x} \leq \bm{d} \end{cases} \end{equation}
where \( \bm{f} \) is a weight vector, the matrix \( \bm{A} \) and vector \( \bm{b} \) define a set of equality constraints, and the matrix \( \bm{C} \) and vector \( \bm{d} \) define a set of inequality constraints.
To obtain the solution, several steps are needed:
| [in] | f | Vector of objective coefficients. |
| [in] | A | Equality constraints matrix. |
| [in] | b | Equality constraints vector. |
| [in] | C | Inequality constraints matrix. |
| [in] | d | Inequality constraints vector. |
| [out] | x | Solution vector (modified only if a solution is actually found). |
| [out] | halt_reason | A short feedback message explaining why the optimization routine halted. |
| [in] | small_number | A small positive tolerance, used to detect near-zero values. In practice, a number n will be considered positive if n > small_number and negative if n < -small_number. Finally, if `-small_nuber <= n <= small_number, then n is treates as zero. |
| [in] | large_number | A "large number". When constraints are not "trivially feasible" ( \( \bm{x}=\bm{0} \) does not satisfy the inequality \( \bm{C}\bm{x}\leq\bm{d} \)) it is necessary to first determine a feasible solution. Two methods are commonly employed:
large_number to a negative value. The penalty method is faster but requires a user-defined constant; set large_number to a positive value to use this method. The value should be several orders of magnitude larger than the values in the objective and constraints. |
Definition at line 152 of file simplex.hxx.