Nonlinear Program.Add Symbolic Constraint Method
Definition
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.3
Overload List
Add | Adds a constraint that is defined by an expression to the nonlinear program. |
Add | Adds a constraint that is defined by an expression to the nonlinear program. |
Add | Adds a constraint that is defined by an expression to the nonlinear program. |
Add | Adds a constraint that is defined by an expression to the nonlinear program. |
AddSymbolicConstraint(Expression<Func<Vector<Double>, Double>>, ConstraintType, Double)
public Constraint AddSymbolicConstraint(
Expression<Func<Vector<double>, double>> constraintFunction,
ConstraintType constraintType,
double rightHandSide
)
Parameters
- constraintFunction Expression<Func<Vector<Double>, Double>>
- A delegate that represents the function that defines the constraint.
- constraintType ConstraintType
- A ConstraintType value that speicifies the type of constraint.
- rightHandSide Double
- The right-hand side of the constraint.
Return Value
ConstraintThe new Constraint.
Remarks
The type of the return value depends on the constraint. If the constraint is linear in the variables, a LinearConstraint is returned, and the bounds of the constraint may be adjusted to take into account constant terms in the expression. Otherwise, a NonlinearConstraint is returned.
AddSymbolicConstraint(Expression<Func<Vector<Double>, Double>>, Double, Double)
public Constraint AddSymbolicConstraint(
Expression<Func<Vector<double>, double>> constraintFunction,
double lowerBound,
double upperBound
)
Parameters
- constraintFunction Expression<Func<Vector<Double>, Double>>
- A delegate that represents the function that defines the constraint.
- lowerBound Double
- The lower bound of the constraint.
- upperBound Double
- The upper bound of the constraint.
Return Value
ConstraintA NonlinearConstraint object that represents the new constraint.
Remarks
The type of the return value depends on the constraint. If the constraint is linear in the variables, a LinearConstraint is returned, and the bounds of the constraint may be adjusted to take into account constant terms in the expression. Otherwise, a NonlinearConstraint is returned.
Exceptions
Argument | constraintFunction is null. |
AddSymbolicConstraint(String, Expression<Func<Vector<Double>, Double>>, ConstraintType, Double)
public Constraint AddSymbolicConstraint(
string? name,
Expression<Func<Vector<double>, double>> constraintFunction,
ConstraintType constraintType,
double rightHandSide
)
Parameters
- name String
- The name of the constraint.
- constraintFunction Expression<Func<Vector<Double>, Double>>
- A delegate that represents the function that defines the constraint.
- constraintType ConstraintType
- A ConstraintType value that speicifies the type of constraint.
- rightHandSide Double
- The right-hand side of the constraint.
Return Value
ConstraintThe new NonlinearConstraint.
Remarks
The type of the return value depends on the constraint. If the constraint is linear in the variables, a LinearConstraint is returned, and the bounds of the constraint may be adjusted to take into account constant terms in the expression. Otherwise, a NonlinearConstraint is returned.
Exceptions
Argument | The nonlinear program already contains a constraint named name. |
Argument | constraintFunction is null. |
AddSymbolicConstraint(String, Expression<Func<Vector<Double>, Double>>, Double, Double)
public Constraint AddSymbolicConstraint(
string? name,
Expression<Func<Vector<double>, double>> constraintFunction,
double lowerBound,
double upperBound
)
Parameters
- name String
- The name of the new constraint.
- constraintFunction Expression<Func<Vector<Double>, Double>>
- A delegate that represents the function that defines the constraint.
- lowerBound Double
- The lower bound of the constraint.
- upperBound Double
- The upper bound of the constraint.
Return Value
ConstraintA NonlinearConstraint object that represents the new constraint.
Remarks
The type of the return value depends on the constraint. If the constraint is linear in the variables, a LinearConstraint is returned, and the bounds of the constraint may be adjusted to take into account constant terms in the expression. Otherwise, a NonlinearConstraint is returned.
Exceptions
Argument | The nonlinear program already contains a constraint named name. |
Argument | constraintFunction is null. |