Optimization::SimplexLP Function

double SimplexLP(TMtx *A, TVec *b, TVec *c, TMtx *AFinal, TVec *X, TVecInt *Indexes, TLPSolution &SolutionType, bool Minimize = true, tStrings *Verbose = null);

Linear optimization by the (primal) Simplex method, A*x <= b.

#NameTypeDescription
1ATMtx *Constraint matrix of the A*x <= b relation; A.Rows = number of constraints (m), A.Cols = number of variables (n).
2bTVec *Right-hand side vector of A*x <= b (length m); must be nonnegative.
3cTVec *Cost vector in f = c^T x (length n).
4AFinalTMtx *Returns the final simplex tableau.
5XTVec *Returns the optimal values of the decision variables (length n).
6IndexesTVecInt *Returns the indices of the basic variables in AFinal.
7SolutionTypeTLPSolution &Returns the class of the LP solution.
8Minimize = trueboolIf true (default) minimize f, otherwise maximize f.
9Verbose = nulltStrings *If assigned, each tableau and pivot is logged; a TOptControl allows interruption/monitoring.
Remarks:

Solves the standard-form linear programming problem

min (max) f(x)=c^Tx subject to A x <= b, x >= 0,

where the right-hand side vector b must be nonnegative, so that the origin is a feasible starting point. For negative components of b use

Optimization::SimplexDual (all rows `>=`) or
Optimization::SimplexTwoPhase (mixed relations).

Returns f = c^T x at the optimum, the optimal point in X (length A.Cols), the indices of the basic variables in Indexes, the final simplex tableau in AFinal and the solution class in SolutionType:

LPFiniteSolution: a bounded optimum was found.

LPUnboundedObjectiveFunction: the objective is unbounded; X is set to zero and -INF (minimize) or +INF (maximize) is returned. With b >= 0 the feasible region is never empty.

An exception is raised if c.Length differs from A.Cols, if b.Length differs from A.Rows, or if the internal iteration limit is exceeded. The computation runs in the precision of A.

Optionally, you can also assign a TOptControl object to the Verbose parameter. This allows the optimization procedure to be interrupted from another thread and optionally also allows logging and iteration count monitoring.

See Also: Optimization::SimplexDual, Optimization::SimplexTwoPhase, Optimization::CPA
Declared in Dew::Math::Units::Optimization · Dew.Math/Units.Optimization.h · Cross-compiler