org.apache.commons.math.optimization
Class PointCostPair

java.lang.Object
  extended by org.apache.commons.math.optimization.PointCostPair

public class PointCostPair
extends java.lang.Object

This class holds a point and its associated cost.

This is a simple immutable container.

Since:
1.2
Version:
$Revision: 620312 $ $Date: 2008-02-10 12:28:59 -0700 (Sun, 10 Feb 2008) $
See Also:
CostFunction

Field Summary
private  double cost
          Cost associated to the point.
private  double[] point
          Point coordinates.
 
Constructor Summary
PointCostPair(double[] point, double cost)
          Build a point/cost pair.
 
Method Summary
 double getCost()
          Get the cost.
 double[] getPoint()
          Get the point.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

point

private final double[] point
Point coordinates.


cost

private final double cost
Cost associated to the point.

Constructor Detail

PointCostPair

public PointCostPair(double[] point,
                     double cost)
Build a point/cost pair.

Parameters:
point - point coordinates (the built instance will store a copy of the array, not the array passed as argument)
cost - point cost
Method Detail

getPoint

public double[] getPoint()
Get the point.

Returns:
a copy of the stored point

getCost

public double getCost()
Get the cost.

Returns:
the stored cost