NMath Reference Guide

## Linear |

Class LinearConstraint represents a linear constraint for a constrained optimization
problem.

Inheritance Hierarchy

Syntax

The LinearConstraint type exposes the following members.

Constructors

Name | Description | |
---|---|---|

LinearConstraint | Constructs an empty constraint problem. Behavior of the constructed object is undefined. | |

LinearConstraint(LinearConstraint) | Constructs a copy of the given LinearConstraint object. | |

LinearConstraint(DoubleVector, Double, ConstraintType) | Constructs a LinearConstraint object from the given parameters. | |

LinearConstraint(ILinearConstraintCoefficients, Double, ConstraintType) | Constructs a LinearConstraint object from the given parameters. | |

LinearConstraint(DoubleVector, Double, ConstraintType, Double) | Constructs a LinearConstraint object from the given parameters. | |

LinearConstraint(ILinearConstraintCoefficients, Double, ConstraintType, Double) | Constructs a LinearConstraint object from the given parameters. |

Properties

Name | Description | |
---|---|---|

Coefficients | Gets and sets the coefficients for the linear combination that is constrained. | |

ConstraintCoefficients | Gets and sets the coefficients for the linear combination that is constrained. | |

RightHandSide | Gets and sets the right hand side, rhs, of the constraint expression c0*x0 + c1*x1 + ... + cn*xn >= (==) rhs | |

Tolerance |
Gets and sets the tolerance for determining whether or not this
constraint is satisfied at a particular point. For
example the equality constraint
c(x) = 0 will be considered to be satisfied at a point x0
if |c(x0)| < Tolerance, and a inequality constraint
c(x) >= 0 will be considered to be satisfied at a point x0
if c(x0) >= -tolerance_.
(Inherited from Constraint) | |

Type |
Gets and sets the type of the constraint, either equality or inequality.
(Inherited from Constraint) |

Methods

Name | Description | |
---|---|---|

Clone |
Returns a deep copy of self.
(Overrides ConstraintClone) | |

Equals(LinearConstraint) | Returns true if the given LinearConstraint is equal to self. Two constraints are equal if they have the same coefficients, right hand side, and are of the same type (equality or inequality). | |

Equals(Object) |
Returns true if the given LinearConstraint is equal to self.
Two constraints are equal if they have the same coefficients, right
hand side, and are of the same type (equality or inequality).
(Overrides ObjectEquals(Object)) | |

EvaluateConstraintFunction(Double) |
Evaluates the constraint function at the
given point.
(Inherited from Constraint) | |

EvaluateConstraintFunction(DoubleVector) |
Evaluates the constraint function at the
given point.
(Overrides ConstraintEvaluateConstraintFunction(DoubleVector)) | |

GetHashCode |
Returns the hash code for this object.
(Overrides ObjectGetHashCode) | |

Gradient(DoubleVector) |
Evaluates the gradient of the constraint function and returns this value.
(Inherited from Constraint) | |

Gradient(DoubleVector, DoubleVector) |
Evaluates the gradient of the constraint function and places in the
given vector.
(Overrides ConstraintGradient(DoubleVector, DoubleVector)) | |

IsSatisfied(DoubleVector) |
Determines if the constraint represented by this instance is
satisfied at the given point.
(Inherited from Constraint) | |

IsSatisfied(DoubleVector, Double) |
Determines if the constraint represented by this instance is
satisfied at the given point withing the given tolerance. The
tolerance associated with this object, accessed with the
Tolerance property, is ignored.
(Inherited from Constraint) | |

ToString |
String representation of a linear constraint.
(Overrides ObjectToString) |

Operators

Name | Description | |
---|---|---|

Equality(LinearConstraint, LinearConstraint) | Compares two LinearConstraint objects for equaltiy. | |

Inequality(LinearConstraint, LinearConstraint) | Compares two LinearConstraint objects for inequaltiy. |

Fields

Name | Description | |
---|---|---|

constraintType_ |
The constraint type.
(Inherited from Constraint) |

Remarks

A linear constraint on a set of variables is a constraint upon a linear
combination of those variables. The LinearConstraint class
supports to two such constraints: equality constraints and lower bound
constraints. That is, given variables x0, x1,..., xn and constants
b, a0, a1,..., an two types of constraints may be formed

a0*x0 + a1*x1 + . . . + an*xn = b

and

a0*x0 + a1*x1 + . . . + an*xn >= b

Upper bound constraints are represented as negations of lower bound constraints.

a0*x0 + a1*x1 + . . . + an*xn = b

and

a0*x0 + a1*x1 + . . . + an*xn >= b

Upper bound constraints are represented as negations of lower bound constraints.

See Also