public class LinearObjectiveFunction
extends java.lang.Object
implements java.io.Serializable
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.
Modifier and Type | Field and Description |
---|---|
private RealVector |
coefficients
Coefficients of the constraint (ci).
|
private double |
constantTerm
Constant term of the linear equation.
|
private static long |
serialVersionUID
Serializable version identifier.
|
Constructor and Description |
---|
LinearObjectiveFunction(double[] coefficients,
double constantTerm) |
LinearObjectiveFunction(RealVector coefficients,
double constantTerm) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other) |
RealVector |
getCoefficients()
Get the coefficients of the linear equation being optimized.
|
double |
getConstantTerm()
Get the constant of the linear equation being optimized.
|
double |
getValue(double[] point)
Compute the value of the linear equation at the current point
|
double |
getValue(RealVector point)
Compute the value of the linear equation at the current point
|
int |
hashCode() |
private void |
readObject(java.io.ObjectInputStream ois)
Deserialize the instance.
|
private void |
writeObject(java.io.ObjectOutputStream oos)
Serialize the instance.
|
private static final long serialVersionUID
private final transient RealVector coefficients
private final double constantTerm
public LinearObjectiveFunction(double[] coefficients, double constantTerm)
coefficients
- The coefficients for the linear equation being optimizedconstantTerm
- The constant term of the linear equationpublic LinearObjectiveFunction(RealVector coefficients, double constantTerm)
coefficients
- The coefficients for the linear equation being optimizedconstantTerm
- The constant term of the linear equationpublic RealVector getCoefficients()
public double getConstantTerm()
public double getValue(double[] point)
point
- point at which linear equation must be evaluatedpublic double getValue(RealVector point)
point
- point at which linear equation must be evaluatedpublic boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
private void writeObject(java.io.ObjectOutputStream oos) throws java.io.IOException
oos
- stream where object should be writtenjava.io.IOException
- if object cannot be written to streamprivate void readObject(java.io.ObjectInputStream ois) throws java.lang.ClassNotFoundException, java.io.IOException
ois
- stream from which the object should be readjava.lang.ClassNotFoundException
- if a class in the stream cannot be foundjava.io.IOException
- if object cannot be read from the streamCopyright (c) 2003-2013 Apache Software Foundation