Package org.hipparchus.optim.linear
Class LinearObjectiveFunction
java.lang.Object
org.hipparchus.optim.linear.LinearObjectiveFunction
- All Implemented Interfaces:
Serializable,MultivariateFunction,OptimizationData
public class LinearObjectiveFunction
extends Object
implements MultivariateFunction, OptimizationData, Serializable
An objective function for a linear optimization problem.
A linear objective function has one the form: \[ c_1 x_1 + \ldots c_n x_n + d \] The ci and d are the coefficients of the equation, the xi are the coordinates of the current point.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionLinearObjectiveFunction(double[] coefficients, double constantTerm) Simple constructor.LinearObjectiveFunction(RealVector coefficients, double constantTerm) Simple constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanGets the coefficients of the linear equation being optimized.doubleGets the constant of the linear equation being optimized.inthashCode()doublevalue(double[] point) Computes the value of the linear equation at the current point.doublevalue(RealVector point) Computes the value of the linear equation at the current point.
-
Constructor Details
-
LinearObjectiveFunction
public LinearObjectiveFunction(double[] coefficients, double constantTerm) Simple constructor.- Parameters:
coefficients- Coefficients for the linear equation being optimized.constantTerm- Constant term of the linear equation.
-
LinearObjectiveFunction
Simple constructor.- Parameters:
coefficients- Coefficients for the linear equation being optimized.constantTerm- Constant term of the linear equation.
-
-
Method Details
-
getCoefficients
Gets the coefficients of the linear equation being optimized.- Returns:
- coefficients of the linear equation being optimized.
-
getConstantTerm
public double getConstantTerm()Gets the constant of the linear equation being optimized.- Returns:
- constant of the linear equation being optimized.
-
value
public double value(double[] point) Computes the value of the linear equation at the current point.- Specified by:
valuein interfaceMultivariateFunction- Parameters:
point- Point at which linear equation must be evaluated.- Returns:
- the value of the linear equation at the current point.
-
value
Computes the value of the linear equation at the current point.- Parameters:
point- Point at which linear equation must be evaluated.- Returns:
- the value of the linear equation at the current point.
-
equals
-
hashCode
public int hashCode()
-