OptimizationModel.AddLinearConstraint Method

Definition

Namespace: Extreme.Mathematics.Optimization
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23

Overload List

AddLinearConstraint(String, ConstraintType, Double) Adds a linear constraint to the optimization model.
AddLinearConstraint(String, Double, Double) Adds a linear constraint to the optimization model.
AddLinearConstraint(IList<DecisionVariable>, IList<Double>, ConstraintType, Double) Adds a linear constraint to the optimization model.
AddLinearConstraint(String, IList<Double>, ConstraintType, Double) Adds a linear constraint to the optimization model.
AddLinearConstraint(String, IList<Double>, Double, Double) Adds a linear constraint to the optimization model.
AddLinearConstraint(String, IList<DecisionVariable>, IList<Double>, ConstraintType, Double) Adds a linear constraint to the optimization model.

OptimizationModel.AddLinearConstraint(String, ConstraintType, Double)

Adds a linear constraint to the optimization model.
C#
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

LinearConstraint
A LinearConstraint object that represents the new constraint.

Exceptions

ArgumentException The optimization model already contains a constraint named name.

OptimizationModel.AddLinearConstraint(String, Double, Double)

Adds a linear constraint to the optimization model.
C#
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

LinearConstraint
A LinearConstraint object that represents the new constraint.

Exceptions

ArgumentException The optimization model already contains a constraint named name.

OptimizationModel.AddLinearConstraint(IList<DecisionVariable>, IList<Double>, ConstraintType, Double)

Adds a linear constraint to the optimization model.
C#
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

LinearConstraint
The new LinearConstraint.

OptimizationModel.AddLinearConstraint(String, IList<Double>, ConstraintType, Double)

Adds a linear constraint to the optimization model.
C#
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

LinearConstraint
The new LinearConstraint.

Exceptions

ArgumentException The optimization model already contains a constraint named name.
ArgumentNullExceptioncoefficients is null.

OptimizationModel.AddLinearConstraint(String, IList<Double>, Double, Double)

Adds a linear constraint to the optimization model.
C#
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

LinearConstraint
A LinearConstraint object that represents the new constraint.

Exceptions

ArgumentException The optimization model already contains a constraint named name.
ArgumentNullExceptioncoefficients is null.

OptimizationModel.AddLinearConstraint(String, IList<DecisionVariable>, IList<Double>, ConstraintType, Double)

Adds a linear constraint to the optimization model.
C#
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

LinearConstraint
The new LinearConstraint.

Exceptions

ArgumentException The optimization model already contains a constraint named name.
ArgumentNullExceptioncoefficients is null.

See Also