Class LinearObjectiveFunction
java.lang.Object
org.apache.commons.math.optimization.linear.LinearObjectiveFunction
- All Implemented Interfaces:
Serializable
An objective function for a linear optimization problem.
A linear objective function has one the form:
c1x1 + ... cnxn + dThe ci and d are the coefficients of the equation, the xi are the coordinates of the current point.
- Since:
- 2.0
- Version:
- $Revision: 922713 $ $Date: 2010-03-14 02:26:13 +0100 (dim. 14 mars 2010) $
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionLinearObjectiveFunction
(double[] coefficients, double constantTerm) LinearObjectiveFunction
(RealVector coefficients, double constantTerm) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Get the coefficients of the linear equation being optimized.double
Get the constant of the linear equation being optimized.double
getValue
(double[] point) Compute the value of the linear equation at the current pointdouble
getValue
(RealVector point) Compute the value of the linear equation at the current pointint
hashCode()
-
Constructor Details
-
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
- Parameters:
coefficients
- The coefficients for the linear equation being optimizedconstantTerm
- The constant term of the linear equation
-
-
Method Details
-
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
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
-
hashCode
public int hashCode()
-