Class LinearObjectiveFunction
- java.lang.Object
-
- org.apache.commons.math.optimization.linear.LinearObjectiveFunction
-
- All Implemented Interfaces:
java.io.Serializable
public class LinearObjectiveFunction extends java.lang.Object implements java.io.SerializableAn objective function for a linear optimization problem.A linear objective function has one the form:
c1x1 + ... cnxn + d
The ci and d are the coefficients of the equation, the xi are the coordinates of the current point.- Since:
- 2.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LinearObjectiveFunction(double[] coefficients, double constantTerm)LinearObjectiveFunction(RealVector coefficients, double constantTerm)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object other)RealVectorgetCoefficients()Get the coefficients of the linear equation being optimized.doublegetConstantTerm()Get the constant of the linear equation being optimized.doublegetValue(double[] point)Compute the value of the linear equation at the current pointdoublegetValue(RealVector point)Compute the value of the linear equation at the current pointinthashCode()
-
-
-
Constructor Detail
-
LinearObjectiveFunction
public LinearObjectiveFunction(double[] coefficients, double constantTerm)- Parameters:
coefficients- The coefficients for the linear equation being optimizedconstantTerm- The constant term of the linear equation
-
LinearObjectiveFunction
public LinearObjectiveFunction(RealVector coefficients, double constantTerm)
- Parameters:
coefficients- The coefficients for the linear equation being optimizedconstantTerm- The constant term of the linear equation
-
-
Method Detail
-
getCoefficients
public RealVector getCoefficients()
Get the coefficients of the linear equation being optimized.- Returns:
- coefficients of the linear equation being optimized
-
getConstantTerm
public double getConstantTerm()
Get the constant of the linear equation being optimized.- Returns:
- constant of the linear equation being optimized
-
getValue
public double getValue(double[] point)
Compute the value of the linear equation at the current point- Parameters:
point- point at which linear equation must be evaluated- Returns:
- value of the linear equation at the current point
-
getValue
public double getValue(RealVector point)
Compute the value of the linear equation at the current point- Parameters:
point- point at which linear equation must be evaluated- Returns:
- value of the linear equation at the current point
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-