Nonlinear Program.Add Nonlinear Constraint Method
Definition
Namespace: Numerics.NET.Optimization
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.3
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.3
Overload List
AddNonlinearConstraint(Func<Vector<Double>, Double>, ConstraintType, Double)
Adds a nonlinear constraint to the nonlinear program.
public NonlinearConstraint AddNonlinearConstraint(
Func<Vector<double>, double> constraintFunction,
ConstraintType constraintType,
double rightHandSide
)
Parameters
- constraintFunction 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
NonlinearConstraintThe new NonlinearConstraint.
AddNonlinearConstraint(Func<Vector<Double>, Double>, Double, Double)
Adds a nonlinear constraint to the nonlinear program.
public NonlinearConstraint AddNonlinearConstraint(
Func<Vector<double>, double> constraintFunction,
double lowerBound,
double upperBound
)
Parameters
- constraintFunction 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
NonlinearConstraintA NonlinearConstraint object that represents the new constraint.
Exceptions
Argument | constraintFunction is null. |
AddNonlinearConstraint(Func<Vector<Double>, Double>, ConstraintType, Double, Func<Vector<Double>, Vector<Double>, Vector<Double>>)
Adds a nonlinear constraint to the nonlinear program.
public NonlinearConstraint AddNonlinearConstraint(
Func<Vector<double>, double> constraintFunction,
ConstraintType constraintType,
double rightHandSide,
Func<Vector<double>, Vector<double>?, Vector<double>> constraintGradient
)
Parameters
- constraintFunction 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.
- constraintGradient Func<Vector<Double>, Vector<Double>, Vector<Double>>
- A delegate that represents the gradient of constraintFunction.
Return Value
NonlinearConstraintThe new NonlinearConstraint.
AddNonlinearConstraint(Func<Vector<Double>, Double>, Double, Double, Func<Vector<Double>, Vector<Double>, Vector<Double>>)
Adds a nonlinear constraint to the nonlinear program.
public NonlinearConstraint AddNonlinearConstraint(
Func<Vector<double>, double> constraintFunction,
double lowerBound,
double upperBound,
Func<Vector<double>, Vector<double>?, Vector<double>> constraintGradient
)
Parameters
- constraintFunction 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.
- constraintGradient Func<Vector<Double>, Vector<Double>, Vector<Double>>
- A delegate that represents the gradient of the constraint function.
Return Value
NonlinearConstraintA NonlinearConstraint object that represents the new constraint.
Exceptions
Argument | constraintFunction is null. |
AddNonlinearConstraint(String, Func<Vector<Double>, Double>, ConstraintType, Double)
Adds a nonlinear constraint to the nonlinear program.
public NonlinearConstraint AddNonlinearConstraint(
string? name,
Func<Vector<double>, double> constraintFunction,
ConstraintType constraintType,
double rightHandSide
)
Parameters
- name String
- The name of the constraint.
- constraintFunction 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
NonlinearConstraintThe new NonlinearConstraint.
Exceptions
Argument | The nonlinear program already contains a constraint named name. |
Argument | constraintFunction is null. |
AddNonlinearConstraint(String, Func<Vector<Double>, Double>, Double, Double)
Adds a nonlinear constraint to the nonlinear program.
public NonlinearConstraint AddNonlinearConstraint(
string? name,
Func<Vector<double>, double> constraintFunction,
double lowerBound,
double upperBound
)
Parameters
- name String
- The name of the new constraint.
- constraintFunction 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
NonlinearConstraintA NonlinearConstraint object that represents the new constraint.
Exceptions
Argument | The nonlinear program already contains a constraint named name. |
Argument | constraintFunction is null. |
AddNonlinearConstraint(String, Func<Vector<Double>, Double>, ConstraintType, Double, Func<Vector<Double>, Vector<Double>, Vector<Double>>)
Adds a nonlinear constraint to the nonlinear program.
public NonlinearConstraint AddNonlinearConstraint(
string? name,
Func<Vector<double>, double> constraintFunction,
ConstraintType constraintType,
double rightHandSide,
Func<Vector<double>, Vector<double>?, Vector<double>>? constraintGradient
)
Parameters
- name String
- The name of the constraint.
- constraintFunction 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.
- constraintGradient Func<Vector<Double>, Vector<Double>, Vector<Double>>
- A delegate that represents the gradient of the constraint function.
Return Value
NonlinearConstraintThe new NonlinearConstraint.
Exceptions
Argument | The nonlinear program already contains a constraint named name. |
Argument | constraintFunction is null. |
AddNonlinearConstraint(String, Func<Vector<Double>, Double>, Double, Double, Func<Vector<Double>, Vector<Double>, Vector<Double>>)
Adds a nonlinear constraint to the nonlinear program.
public NonlinearConstraint AddNonlinearConstraint(
string? name,
Func<Vector<double>, double> constraintFunction,
double lowerBound,
double upperBound,
Func<Vector<double>, Vector<double>?, Vector<double>>? constraintGradient
)
Parameters
- name String
- The name of the new constraint.
- constraintFunction 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.
- constraintGradient Func<Vector<Double>, Vector<Double>, Vector<Double>>
- A delegate that represents the gradient of the constraint function.
Return Value
NonlinearConstraintA NonlinearConstraint object that represents the new constraint.
Exceptions
Argument | The nonlinear program already contains a constraint named name. |
Argument | constraintFunction is null. |