Click or drag to resize

LinearConstraint Class

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

Namespace:  CenterSpace.NMath.Core
Assembly:  NMath (in NMath.dll) Version: 7.3
Syntax
[SerializableAttribute]
public class LinearConstraint : Constraint, 
	IEquatable<LinearConstraint>

The LinearConstraint type exposes the following members.

Constructors
  NameDescription
Public methodLinearConstraint
Constructs an empty constraint problem. Behavior of the constructed object is undefined.
Public methodLinearConstraint(LinearConstraint)
Constructs a copy of the given LinearConstraint object.
Public methodLinearConstraint(DoubleVector, Double, ConstraintType)
Constructs a LinearConstraint object from the given parameters.
Public methodLinearConstraint(ILinearConstraintCoefficients, Double, ConstraintType)
Constructs a LinearConstraint object from the given parameters.
Public methodLinearConstraint(DoubleVector, Double, ConstraintType, Double)
Constructs a LinearConstraint object from the given parameters.
Public methodLinearConstraint(ILinearConstraintCoefficients, Double, ConstraintType, Double)
Constructs a LinearConstraint object from the given parameters.
Top
Properties
  NameDescription
Public propertyCoefficients
Gets and sets the coefficients for the linear combination that is constrained.
Public propertyConstraintCoefficients
Gets and sets the coefficients for the linear combination that is constrained.
Public propertyRightHandSide
Gets and sets the right hand side, rhs, of the constraint expression c0*x0 + c1*x1 + ... + cn*xn >= (==) rhs
Public propertyTolerance
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.)
Public propertyType
Gets and sets the type of the constraint, either equality or inequality.
(Inherited from Constraint.)
Top
Methods
  NameDescription
Public methodClone
Returns a deep copy of self.
(Overrides ConstraintClone.)
Public methodEquals(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).)
Public methodEquals(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).
Public methodEvaluateConstraintFunction(Double)
Evaluates the constraint function at the given point.
(Inherited from Constraint.)
Public methodEvaluateConstraintFunction(DoubleVector)
Evaluates the constraint function at the given point.
(Overrides ConstraintEvaluateConstraintFunction(DoubleVector).)
Public methodGetHashCode
Returns the hash code for this object.
(Overrides ObjectGetHashCode.)
Public methodGradient(DoubleVector)
Evaluates the gradient of the constraint function and returns this value.
(Inherited from Constraint.)
Public methodGradient(DoubleVector, DoubleVector)
Evaluates the gradient of the constraint function and places in the given vector.
(Overrides ConstraintGradient(DoubleVector, DoubleVector).)
Public methodIsSatisfied(DoubleVector)
Determines if the constraint represented by this instance is satisfied at the given point.
(Inherited from Constraint.)
Public methodIsSatisfied(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.)
Public methodToString
String representation of a linear constraint.
(Overrides ObjectToString.)
Top
Operators
  NameDescription
Public operatorStatic memberEquality
Compares two LinearConstraint objects for equaltiy.
Public operatorStatic memberInequality
Compares two LinearConstraint objects for inequaltiy.
Top
Fields
  NameDescription
Protected fieldconstraintType_
The constraint type.
(Inherited from Constraint.)
Top
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.
See Also