﻿LinearConstraint Class

# 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
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.
Top
Properties
NameDescription
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.)
Top
Methods
NameDescription
Clone
Returns a deep copy of self.
(Overrides ConstraintClone.)
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).)
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).
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.)
Evaluates the gradient of the constraint function and returns this value.
(Inherited from Constraint.)
Evaluates the gradient of the constraint function and places in the given vector.
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.)
Top
Operators
NameDescription
Equality
Compares two LinearConstraint objects for equaltiy.
Inequality
Compares two LinearConstraint objects for inequaltiy.
Top
Fields
NameDescription
constraintType_
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.