NMath Reference Guide

## Constrained |

Class that encapsulates a constrained least squares problem.

Inheritance Hierarchy

SystemObject

CenterSpace.NMath.CoreBoundedVariableProblem

CenterSpace.NMath.CoreLinearConstrainedProblem

CenterSpace.NMath.CoreConstrainedLeastSquaresProblem

CenterSpace.NMath.CoreBoundedVariableProblem

CenterSpace.NMath.CoreLinearConstrainedProblem

CenterSpace.NMath.CoreConstrainedLeastSquaresProblem

Syntax

The ConstrainedLeastSquaresProblem type exposes the following members.

Constructors

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

ConstrainedLeastSquaresProblem | Constructs an empty ConstrainedLeastSquaresProblem instance. | |

ConstrainedLeastSquaresProblem(DoubleMatrix, DoubleVector) | Constructs a ConstrainedLeastSquaresProblem instance for the problem Ax = b. |

Properties

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

A | Gets and sets the matrix A in the problem Ax = b. | |

b | Gets and sets the vector b in the problem Ax = b. | |

Constraints |
Gets and sets the linear constraints for the problem.
(Inherited from LinearConstrainedProblem) | |

NumVariables |
Gets the number of independent variables for the problem.
(Overrides BoundedVariableProblemNumVariables) | |

VariableBounds |
Gets and sets variable bounds for the problem.
(Inherited from BoundedVariableProblem) |

Methods

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

AddBounds(Int32, Double, Double) |
Adds upper and lower bound constraints to a variable.
(Inherited from BoundedVariableProblem) | |

AddBounds(Int32, Double, Double, Double) |
Adds upper and lower bound constraints to a variable.
(Inherited from BoundedVariableProblem) | |

AddConstraint(LinearConstraint) |
Adds the given constraint to the problem.
(Inherited from LinearConstrainedProblem) | |

AddConstraint(DoubleVector, Double, Double) |
Adds a linear inequality constraint of the form
lowerBound <= coefficients'x < upperBound
(Inherited from LinearConstrainedProblem) | |

AddConstraint(ILinearConstraintCoefficients, Double, Double) |
Adds a linear inequality constraint of the form
lowerBound <= coefficients'x < upperBound
(Inherited from LinearConstrainedProblem) | |

AddConstraint(DoubleVector, Double, Double, Double) |
Adds a linear inequality constraint of the form
lowerBound <= coefficients'x < upperBound
(Inherited from LinearConstrainedProblem) | |

AddConstraint(ILinearConstraintCoefficients, Double, Double, Double) |
Adds a linear inequality constraint of the form
lowerBound <= coefficients'x < upperBound
(Inherited from LinearConstrainedProblem) | |

AddEqualityConstraint(DoubleVector, Double) |
Adds an equality constraint of the form
coefficients'x = rightHandSide
(Inherited from LinearConstrainedProblem) | |

AddEqualityConstraint(ILinearConstraintCoefficients, Double) |
Adds an equality constraint of the form
coefficients'x = rightHandSide
(Inherited from LinearConstrainedProblem) | |

AddLowerBound(Int32, Double) |
Adds an lower bound constraint on the variable at the given index.
(Inherited from BoundedVariableProblem) | |

AddLowerBound(Int32, Double, Double) |
Adds an lower bound constraint on the variable at the given index.
(Inherited from BoundedVariableProblem) | |

AddLowerBoundConstraint(DoubleVector, Double) |
Adds a linear inequality constraint of the form
coefficients'x >= lowerBound
(Inherited from LinearConstrainedProblem) | |

AddLowerBoundConstraint(ILinearConstraintCoefficients, Double) |
Adds a linear inequality constraint of the form
coefficients'x >= lowerBound
(Inherited from LinearConstrainedProblem) | |

AddLowerBoundConstraint(DoubleVector, Double, Double) |
Adds a linear inequality constraint of the form
coefficients'x >= lowerBound
(Inherited from LinearConstrainedProblem) | |

AddLowerBoundConstraint(ILinearConstraintCoefficients, Double, Double) |
Adds a linear inequality constraint of the form
coefficients'x >= lowerBound
(Inherited from LinearConstrainedProblem) | |

AddUpperBound(Int32, Double) |
Adds an upper bound constraint on the variable at the given index.
(Inherited from BoundedVariableProblem) | |

AddUpperBound(Int32, Double, Double) |
Adds an upper bound constraint on the variable at the given index.
(Inherited from BoundedVariableProblem) | |

AddUpperBoundConstraint(DoubleVector, Double) |
Adds a linear inequality constraint of the form
coefficients'x <= upperBound
(Inherited from LinearConstrainedProblem) | |

AddUpperBoundConstraint(ILinearConstraintCoefficients, Double) |
Adds a linear inequality constraint of the form
coefficients'x <= upperBound
(Inherited from LinearConstrainedProblem) | |

AddUpperBoundConstraint(DoubleVector, Double, Double) |
Adds a linear inequality constraint of the form
coefficients'x <= upperBound
(Inherited from LinearConstrainedProblem) | |

AddUpperBoundConstraint(ILinearConstraintCoefficients, Double, Double) |
Adds a linear inequality constraint of the form
coefficients'x <= upperBound
(Inherited from LinearConstrainedProblem) | |

CheckVariableIndex |
Bounds checks the given variable index .
(Overrides BoundedVariableProblemCheckVariableIndex(Int32)) | |

Clone | Returns a deep copy of self. | |

EvaluateConstraints |
Evaluates each of the constraints at the specified point and
returns the results.
(Inherited from LinearConstrainedProblem) | |

PointIsFeasible(DoubleVector) |
Function for determining the feasibility of a give point. A point
x is feasible if it satisfies all the constraints of the
problem.
(Inherited from LinearConstrainedProblem) | |

PointIsFeasible(DoubleVector, Double) |
Function for determining the feasibility of a give point.
(Inherited from LinearConstrainedProblem) |

Fields

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

constraints_ |
Problem constraints.
(Inherited from LinearConstrainedProblem) | |

variableBounds_ |
Map containing variable bounds. Key is the variable ID, the value is the bounds.
(Inherited from BoundedVariableProblem) |

Remarks

Minimize ||Ax - b||^2
/// Subject to

ai'x = bi, for i in E,

ai'x >= bi, for i in I

where A is an mxn matrix, b is an m-vector, each ai is an n-vector and each bi is a scalar. ||.||^2 denotes the Euclidean norm squared.

ai'x = bi, for i in E,

ai'x >= bi, for i in I

where A is an mxn matrix, b is an m-vector, each ai is an n-vector and each bi is a scalar. ||.||^2 denotes the Euclidean norm squared.

See Also