Constructs a new linear program in standard form.
Namespace: Extreme.Mathematics.OptimizationAssembly: Extreme.Numerics.Net40 (in Extreme.Numerics.Net40.dll) Version: 6.0.16073.0 (6.0.16312.0)
public LinearProgram(
Vector objective,
Matrix constraints,
Vector rightHandSides,
int equalities
)
Public Sub New (
objective As Vector,
constraints As Matrix,
rightHandSides As Vector,
equalities As Integer
)
public:
LinearProgram(
Vector^ objective,
Matrix^ constraints,
Vector^ rightHandSides,
int equalities
)
new :
objective : Vector *
constraints : Matrix *
rightHandSides : Vector *
equalities : int -> LinearProgram
Parameters
- objective
- Type: Extreme.MathematicsVector
The vector of coefficients of the objective function. - constraints
- Type: Extreme.MathematicsMatrix
The matrix of coefficients of the constraints. - rightHandSides
- Type: Extreme.MathematicsVector
The vector of right-hand-sides of the constraints. - equalities
- Type: SystemInt32
The number of equality constraints.
Exception | Condition |
---|
ArgumentNullException | objective is .
-or- constraints is . -or- rightHandSides is . |
ArgumentOutOfRangeException | equalities is less than zero or greater than the number of constraints.
|
DimensionMismatchException |
The length of rightHandSides does not equal the number of rows of constraints.
-or- The length of objective does not equal the number of columns of constraints. |
Use this constructor to create a linear program in standard form with equality constraints.
It is more efficient to specify an equality constraint as a single constraint
rather than as two inequality constraints with opposite bounds. This constructor is preferred
for linear programs in standard form with equality constraints.
The equalities must be listed first in the constraint matrix and in the right-hand sides,
followed by the inequalities.
Note that it is much more efficient to specify bounds on variables directly than to encode
the bounds in additional constraints. It is also more efficient to specify a boxed constraint
as a single constraint than as two inequality constraints with opposite bounds.
For linear programs with such constraints, the more general constructor is recommended.
The variables are given the names x1, x2... Constraints are given the names
C1, C2...
Numerical Libraries
Supported in: 5.x, 4.x
Reference