Class LinearConstraint
java.lang.Object
org.apache.commons.math3.optimization.linear.LinearConstraint
- All Implemented Interfaces:
Serializable
Deprecated.
As of 3.1 (to be removed in 4.0).
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
- Since:
- 2.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final RealVector
Deprecated.Coefficients of the constraint (left hand side).private final Relationship
Deprecated.Relationship between left and right hand sides (=, <=, >=).private static final long
Deprecated.Serializable version identifier.private final double
Deprecated.Value of the constraint (right hand side). -
Constructor Summary
ConstructorsConstructorDescriptionLinearConstraint
(double[] lhsCoefficients, double lhsConstant, Relationship relationship, double[] rhsCoefficients, double rhsConstant) Deprecated.Build a constraint involving two linear equations.LinearConstraint
(double[] coefficients, Relationship relationship, double value) Deprecated.Build a constraint involving a single linear equation.LinearConstraint
(RealVector lhsCoefficients, double lhsConstant, Relationship relationship, RealVector rhsCoefficients, double rhsConstant) Deprecated.Build a constraint involving two linear equations.LinearConstraint
(RealVector coefficients, Relationship relationship, double value) Deprecated.Build a constraint involving a single linear equation. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Deprecated.Deprecated.Get the coefficients of the constraint (left hand side).Deprecated.Get the relationship between left and right hand sides.double
getValue()
Deprecated.Get the value of the constraint (right hand side).int
hashCode()
Deprecated.private void
Deprecated.Deserialize the instance.private void
Deprecated.Serialize the instance.
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDDeprecated.Serializable version identifier.- See Also:
-
coefficients
Deprecated.Coefficients of the constraint (left hand side). -
relationship
Deprecated.Relationship between left and right hand sides (=, <=, >=). -
value
private final double valueDeprecated.Value of the constraint (right hand side).
-
-
Constructor Details
-
LinearConstraint
Deprecated.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
Deprecated.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) Deprecated.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) Deprecated.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
Deprecated.Get the coefficients of the constraint (left hand side).- Returns:
- coefficients of the constraint (left hand side)
-
getRelationship
Deprecated.Get the relationship between left and right hand sides.- Returns:
- relationship between left and right hand sides
-
getValue
public double getValue()Deprecated.Get the value of the constraint (right hand side).- Returns:
- value of the constraint (right hand side)
-
equals
Deprecated. -
hashCode
public int hashCode()Deprecated. -
writeObject
Deprecated.Serialize the instance.- Parameters:
oos
- stream where object should be written- Throws:
IOException
- if object cannot be written to stream
-
readObject
Deprecated.Deserialize the instance.- Parameters:
ois
- stream from which the object should be read- Throws:
ClassNotFoundException
- if a class in the stream cannot be foundIOException
- if object cannot be read from the stream
-