Package org.apache.commons.math3.optim
Class PointValuePair
- java.lang.Object
-
- org.apache.commons.math3.util.Pair<double[],java.lang.Double>
-
- org.apache.commons.math3.optim.PointValuePair
-
- All Implemented Interfaces:
java.io.Serializable
public class PointValuePair extends Pair<double[],java.lang.Double> implements java.io.Serializable
This class holds a point and the value of an objective function at that point.- Since:
- 3.0
- See Also:
PointVectorValuePair
,MultivariateFunction
, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
PointValuePair.DataTransferObject
Internal class used only for serialization.
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
Serializable UID.
-
Constructor Summary
Constructors Constructor Description PointValuePair(double[] point, double value)
Builds a point/objective function value pair.PointValuePair(double[] point, double value, boolean copyArray)
Builds a point/objective function value pair.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double[]
getPoint()
Gets the point.double[]
getPointRef()
Gets a reference to the point.private java.lang.Object
writeReplace()
Replace the instance with a data transfer object for serialization.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
Serializable UID.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PointValuePair
public PointValuePair(double[] point, double value)
Builds a point/objective function value pair.- Parameters:
point
- Point coordinates. This instance will store a copy of the array, not the array passed as argument.value
- Value of the objective function at the point.
-
PointValuePair
public PointValuePair(double[] point, double value, boolean copyArray)
Builds a point/objective function value pair.- Parameters:
point
- Point coordinates.value
- Value of the objective function at the point.copyArray
- iftrue
, the input array will be copied, otherwise it will be referenced.
-
-
Method Detail
-
getPoint
public double[] getPoint()
Gets the point.- Returns:
- a copy of the stored point.
-
getPointRef
public double[] getPointRef()
Gets a reference to the point.- Returns:
- a reference to the internal array storing the point.
-
writeReplace
private java.lang.Object writeReplace()
Replace the instance with a data transfer object for serialization.- Returns:
- data transfer object that will be serialized
-
-