Package org.hipparchus.optim.linear
Class LinearConstraint
java.lang.Object
org.hipparchus.optim.linear.LinearConstraint
- All Implemented Interfaces:
Serializable
A linear constraint for a linear optimization problem.
* A linear constraint has one of the forms:
- c1x1 + ... cnxn = v
- c1x1 + ... cnxn <= v
- c1x1 + ... cnxn >= v
- l1x1 + ... lnxn + lcst = r1x1 + ... rnxn + rcst
- l1x1 + ... lnxn + lcst <= r1x1 + ... rnxn + rcst
- l1x1 + ... lnxn + lcst >= r1x1 + ... rnxn + rcst
The ci, li or ri are the coefficients of the constraints, the xi are the coordinates of the current point and v is the value of the constraint.
- See Also:
-
Constructor Summary
ConstructorDescriptionLinearConstraint
(double[] lhsCoefficients, double lhsConstant, Relationship relationship, double[] rhsCoefficients, double rhsConstant) Build a constraint involving two linear equations.LinearConstraint
(double[] coefficients, Relationship relationship, double value) Build a constraint involving a single linear equation.LinearConstraint
(RealVector lhsCoefficients, double lhsConstant, Relationship relationship, RealVector rhsCoefficients, double rhsConstant) Build a constraint involving two linear equations.LinearConstraint
(RealVector coefficients, Relationship relationship, double value) Build a constraint involving a single linear equation. -
Method Summary
-
Constructor Details
-
LinearConstraint
Build a constraint involving a single linear equation.A linear constraint with a single linear equation has one of the forms:
- c1x1 + ... cnxn = v
- c1x1 + ... cnxn <= v
- c1x1 + ... cnxn >= v
- Parameters:
coefficients
- The coefficients of the constraint (left hand side)relationship
- The type of (in)equality used in the constraintvalue
- The value of the constraint (right hand side)
-
LinearConstraint
Build a constraint involving a single linear equation.A linear constraint with a single linear equation has one of the forms:
- c1x1 + ... cnxn = v
- c1x1 + ... cnxn <= v
- c1x1 + ... cnxn >= v
- Parameters:
coefficients
- The coefficients of the constraint (left hand side)relationship
- The type of (in)equality used in the constraintvalue
- The value of the constraint (right hand side)
-
LinearConstraint
public LinearConstraint(double[] lhsCoefficients, double lhsConstant, Relationship relationship, double[] rhsCoefficients, double rhsConstant) Build a constraint involving two linear equations.A linear constraint with two linear equation has one of the forms:
- l1x1 + ... lnxn + lcst = r1x1 + ... rnxn + rcst
- l1x1 + ... lnxn + lcst <= r1x1 + ... rnxn + rcst
- l1x1 + ... lnxn + lcst >= r1x1 + ... rnxn + rcst
- Parameters:
lhsCoefficients
- The coefficients of the linear expression on the left hand side of the constraintlhsConstant
- The constant term of the linear expression on the left hand side of the constraintrelationship
- The type of (in)equality used in the constraintrhsCoefficients
- The coefficients of the linear expression on the right hand side of the constraintrhsConstant
- The constant term of the linear expression on the right hand side of the constraint
-
LinearConstraint
public LinearConstraint(RealVector lhsCoefficients, double lhsConstant, Relationship relationship, RealVector rhsCoefficients, double rhsConstant) Build a constraint involving two linear equations.A linear constraint with two linear equation has one of the forms:
- l1x1 + ... lnxn + lcst = r1x1 + ... rnxn + rcst
- l1x1 + ... lnxn + lcst <= r1x1 + ... rnxn + rcst
- l1x1 + ... lnxn + lcst >= r1x1 + ... rnxn + rcst
- Parameters:
lhsCoefficients
- The coefficients of the linear expression on the left hand side of the constraintlhsConstant
- The constant term of the linear expression on the left hand side of the constraintrelationship
- The type of (in)equality used in the constraintrhsCoefficients
- The coefficients of the linear expression on the right hand side of the constraintrhsConstant
- The constant term of the linear expression on the right hand side of the constraint
-
-
Method Details
-
getCoefficients
Gets the coefficients of the constraint (left hand side).- Returns:
- the coefficients of the constraint (left hand side).
-
getRelationship
Gets the relationship between left and right hand sides.- Returns:
- the relationship between left and right hand sides.
-
getValue
public double getValue()Gets the value of the constraint (right hand side).- Returns:
- the value of the constraint (right hand side).
-
equals
-
hashCode
public int hashCode()
-