Class RealPointValuePair

java.lang.Object
org.apache.commons.math.optimization.RealPointValuePair
All Implemented Interfaces:
Serializable

public class RealPointValuePair extends Object implements Serializable
This class holds a point and the value of an objective function at this point.

This is a simple immutable container.

Since:
2.0
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    RealPointValuePair(double[] point, double value)
    Build a point/objective function value pair.
    RealPointValuePair(double[] point, double value, boolean copyArray)
    Build a point/objective function value pair.
  • Method Summary

    Modifier and Type
    Method
    Description
    double[]
    Get the point.
    double[]
    Get a reference to the point.
    double
    Get the value of the objective function.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RealPointValuePair

      public RealPointValuePair(double[] point, double value)
      Build a point/objective function value pair.
      Parameters:
      point - point coordinates (the built instance will store a copy of the array, not the array passed as argument)
      value - value of an objective function at the point
    • RealPointValuePair

      public RealPointValuePair(double[] point, double value, boolean copyArray)
      Build a point/objective function value pair.
      Parameters:
      point - point coordinates (the built instance will store a copy of the array, not the array passed as argument)
      value - value of an objective function at the point
      copyArray - if true, the input array will be copied, otherwise it will be referenced
  • Method Details

    • getPoint

      public double[] getPoint()
      Get the point.
      Returns:
      a copy of the stored point
    • getPointRef

      public double[] getPointRef()
      Get a reference to the point.

      This method is provided as a convenience to avoid copying the array, the elements of the array should not be modified.

      Returns:
      a reference to the internal array storing the point
    • getValue

      public double getValue()
      Get the value of the objective function.
      Returns:
      the stored value of the objective function