Optimization Model.Add Linear Constraint Method
Definition
Namespace: Numerics.NET.Optimization
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.4
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.4
Overload List
Add | Adds a linear constraint to the optimization model. |
Add | Adds a linear constraint to the optimization model. |
Add | Adds a linear constraint to the optimization model. |
Add | Adds a linear constraint to the optimization model. |
Add | Adds a linear constraint to the optimization model. |
Add | Adds a linear constraint to the optimization model. |
AddLinearConstraint(String, ConstraintType, Double)
Adds a linear constraint to the optimization model.
public LinearConstraint AddLinearConstraint(
string name,
ConstraintType constraintType,
double rightHandSide
)
Parameters
- name String
- The name of the new constraint.
- constraintType ConstraintType
- A ConstraintType value that specifies the type of constraint.
- rightHandSide Double
- The right-hand side of the constraint.
Return Value
LinearConstraintA LinearConstraint object that represents the new constraint.
Exceptions
Argument | The optimization model already contains a constraint named name. |
AddLinearConstraint(String, Double, Double)
Adds a linear constraint to the optimization model.
public LinearConstraint AddLinearConstraint(
string name,
double lowerBound,
double upperBound
)
Parameters
- name String
- The name of the new constraint.
- lowerBound Double
- The lower bound of the constraint.
- upperBound Double
- The upper bound of the constraint.
Return Value
LinearConstraintA LinearConstraint object that represents the new constraint.
Exceptions
Argument | The optimization model already contains a constraint named name. |
AddLinearConstraint(IList<DecisionVariable>, IList<Double>, ConstraintType, Double)
Adds a linear constraint to the optimization model.
public LinearConstraint AddLinearConstraint(
IList<DecisionVariable> variables,
IList<double> coefficients,
ConstraintType constraintType,
double rightHandSide
)
Parameters
- variables IList<DecisionVariable>
- A list of the variables that appear in the constraint.
- coefficients IList<Double>
- A list of corresponding coefficients.
- constraintType ConstraintType
- A ConstraintType value that speicifies the type of constraint.
- rightHandSide Double
- The right-hand side of the constraint.
Return Value
LinearConstraintThe new LinearConstraint.
AddLinearConstraint(String, IList<Double>, ConstraintType, Double)
Adds a linear constraint to the optimization model.
public LinearConstraint AddLinearConstraint(
string name,
IList<double> coefficients,
ConstraintType constraintType,
double rightHandSide
)
Parameters
- name String
- The name of the constraint.
- coefficients IList<Double>
- A list of real numbers containing the coefficients of the variables in the constraint.
- constraintType ConstraintType
- A ConstraintType value that speicifies the type of constraint.
- rightHandSide Double
- The right-hand side of the constraint.
Return Value
LinearConstraintThe new LinearConstraint.
Exceptions
Argument | The optimization model already contains a constraint named name. |
Argument | coefficients is null. |
AddLinearConstraint(String, IList<Double>, Double, Double)
Adds a linear constraint to the optimization model.
public LinearConstraint AddLinearConstraint(
string name,
IList<double> coefficients,
double lowerBound,
double upperBound
)
Parameters
- name String
- The name of the new constraint.
- coefficients IList<Double>
- A vector containing the coefficients in the constraint.
- lowerBound Double
- The lower bound of the constraint.
- upperBound Double
- The upper bound of the constraint.
Return Value
LinearConstraintA LinearConstraint object that represents the new constraint.
Exceptions
Argument | The optimization model already contains a constraint named name. |
Argument | coefficients is null. |
AddLinearConstraint(String, IList<DecisionVariable>, IList<Double>, ConstraintType, Double)
Adds a linear constraint to the optimization model.
public LinearConstraint AddLinearConstraint(
string? name,
IList<DecisionVariable> variables,
IList<double> coefficients,
ConstraintType constraintType,
double rightHandSide
)
Parameters
- name String
- The name of the constraint.
- variables IList<DecisionVariable>
- A list of the variables that appear in the constraint.
- coefficients IList<Double>
- A list of corresponding coefficients.
- constraintType ConstraintType
- A ConstraintType value that speicifies the type of constraint.
- rightHandSide Double
- The right-hand side of the constraint.
Return Value
LinearConstraintThe new LinearConstraint.
Exceptions
Argument | The optimization model already contains a constraint named name. |
Argument | coefficients is null. |