Author: erans
Date: Sun Feb 12 20:00:31 2012
New Revision: 1243310
URL: http://svn.apache.org/viewvc?rev=1243310&view=rev
Log:
MATH-707
Renamed "VectorialPointValuePair" to "PointVectorValuePair" and made it a
subclass of "Pair<double[], double[]>".
Added:
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/PointVectorValuePair.java
- copied, changed from r1243186,
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/VectorialPointValuePair.java
Removed:
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/VectorialPointValuePair.java
Modified:
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseMultivariateVectorMultiStartOptimizer.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseMultivariateVectorOptimizer.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/PointValuePair.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/SimpleVectorialPointChecker.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/SimpleVectorialValueChecker.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/VectorialConvergenceChecker.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/BaseAbstractMultivariateVectorOptimizer.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/fitting/CurveFitter.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/AbstractLeastSquaresOptimizer.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/GaussNewtonOptimizer.java
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/LevenbergMarquardtOptimizer.java
commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/DifferentiableMultivariateVectorMultiStartOptimizerTest.java
commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/GaussNewtonOptimizerTest.java
commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/LevenbergMarquardtOptimizerTest.java
commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/MinpackTest.java
Modified:
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseMultivariateVectorMultiStartOptimizer.java
URL:
http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseMultivariateVectorMultiStartOptimizer.java?rev=1243310&r1=1243309&r2=1243310&view=diff
==============================================================================
---
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseMultivariateVectorMultiStartOptimizer.java
(original)
+++
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseMultivariateVectorMultiStartOptimizer.java
Sun Feb 12 20:00:31 2012
@@ -53,7 +53,7 @@ public class BaseMultivariateVectorMulti
/** Random generator for multi-start. */
private RandomVectorGenerator generator;
/** Found optima. */
- private VectorialPointValuePair[] optima;
+ private PointVectorValuePair[] optima;
/**
* Create a multi-start optimizer from a single-start optimizer.
@@ -110,7 +110,7 @@ public class BaseMultivariateVectorMulti
* #optimize(int,MultivariateVectorFunction,double[],double[],double[])
optimize} has not been
* called.
*/
- public VectorialPointValuePair[] getOptima() {
+ public PointVectorValuePair[] getOptima() {
if (optima == null) {
throw new
MathIllegalStateException(LocalizedFormats.NO_OPTIMUM_COMPUTED_YET);
}
@@ -128,19 +128,19 @@ public class BaseMultivariateVectorMulti
}
/** {@inheritDoc} */
- public ConvergenceChecker<VectorialPointValuePair> getConvergenceChecker()
{
+ public ConvergenceChecker<PointVectorValuePair> getConvergenceChecker() {
return optimizer.getConvergenceChecker();
}
/**
* {@inheritDoc}
*/
- public VectorialPointValuePair optimize(int maxEval, final FUNC f,
+ public PointVectorValuePair optimize(int maxEval, final FUNC f,
double[] target, double[] weights,
double[] startPoint) {
maxEvaluations = maxEval;
RuntimeException lastException = null;
- optima = new VectorialPointValuePair[starts];
+ optima = new PointVectorValuePair[starts];
totalEvaluations = 0;
// Multi-start loop.
@@ -179,9 +179,9 @@ public class BaseMultivariateVectorMulti
*/
private void sortPairs(final double[] target,
final double[] weights) {
- Arrays.sort(optima, new Comparator<VectorialPointValuePair>() {
- public int compare(final VectorialPointValuePair o1,
- final VectorialPointValuePair o2) {
+ Arrays.sort(optima, new Comparator<PointVectorValuePair>() {
+ public int compare(final PointVectorValuePair o1,
+ final PointVectorValuePair o2) {
if (o1 == null) {
return (o2 == null) ? 0 : 1;
} else if (o2 == null) {
@@ -189,7 +189,7 @@ public class BaseMultivariateVectorMulti
}
return Double.compare(weightedResidual(o1),
weightedResidual(o2));
}
- private double weightedResidual(final VectorialPointValuePair
pv) {
+ private double weightedResidual(final PointVectorValuePair pv)
{
final double[] value = pv.getValueRef();
double sum = 0;
for (int i = 0; i < value.length; ++i) {
Modified:
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseMultivariateVectorOptimizer.java
URL:
http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseMultivariateVectorOptimizer.java?rev=1243310&r1=1243309&r2=1243310&view=diff
==============================================================================
---
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseMultivariateVectorOptimizer.java
(original)
+++
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseMultivariateVectorOptimizer.java
Sun Feb 12 20:00:31 2012
@@ -33,7 +33,7 @@ import org.apache.commons.math.analysis.
* @since 3.0
*/
public interface BaseMultivariateVectorOptimizer<FUNC extends
MultivariateVectorFunction>
- extends BaseOptimizer<VectorialPointValuePair> {
+ extends BaseOptimizer<PointVectorValuePair> {
/**
* Optimize an objective function.
* Optimization is considered to be a weighted least-squares minimization.
@@ -54,6 +54,6 @@ public interface BaseMultivariateVectorO
* @throws org.apache.commons.math.exception.NullArgumentException if
* any argument is {@code null}.
*/
- VectorialPointValuePair optimize(int maxEval, FUNC f, double[] target,
+ PointVectorValuePair optimize(int maxEval, FUNC f, double[] target,
double[] weight, double[] startPoint);
}
Modified:
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/PointValuePair.java
URL:
http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/PointValuePair.java?rev=1243310&r1=1243309&r2=1243310&view=diff
==============================================================================
---
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/PointValuePair.java
(original)
+++
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/PointValuePair.java
Sun Feb 12 20:00:31 2012
@@ -23,6 +23,7 @@ import org.apache.commons.math.util.Pair
* This class holds a point and the value of an objective function at
* that point.
*
+ * @see PointVectorValuePair
* @see org.apache.commons.math.analysis.MultivariateFunction
* @version $Id$
* @since 3.0
@@ -31,8 +32,8 @@ public class PointValuePair extends Pair
/**
* Builds a point/objective function value pair.
*
- * @param point Point coordinates (this instance will store
- * a copy of the array, not the array passed as argument).
+ * @param point Point coordinates. This instance will store
+ * a copy of the array, not the array passed as argument.
* @param value Value of the objective function at the point.
*/
public PointValuePair(final double[] point,
@@ -63,7 +64,8 @@ public class PointValuePair extends Pair
* @return a copy of the stored point.
*/
public double[] getPoint() {
- return getKey().clone();
+ final double[] p = getKey();
+ return p == null ? null : p.clone();
}
/**
Copied:
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/PointVectorValuePair.java
(from r1243186,
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/VectorialPointValuePair.java)
URL:
http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/PointVectorValuePair.java?p2=commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/PointVectorValuePair.java&p1=commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/VectorialPointValuePair.java&r1=1243186&r2=1243310&rev=1243310&view=diff
==============================================================================
---
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/VectorialPointValuePair.java
(original)
+++
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/PointVectorValuePair.java
Sun Feb 12 20:00:31 2012
@@ -17,84 +17,88 @@
package org.apache.commons.math.optimization;
-import java.io.Serializable;
+import org.apache.commons.math.util.Pair;
/**
- * This class holds a point and the vectorial value of an objective function
at this point.
- * <p>This is a simple immutable container.</p>
+ * This class holds a point and the vectorial value of an objective function at
+ * that point.
+ *
* @see PointValuePair
* @see org.apache.commons.math.analysis.MultivariateVectorFunction
* @version $Id$
- * @since 2.0
+ * @since 3.0
*/
-public class VectorialPointValuePair implements Serializable {
-
- /** Serializable version identifier. */
- private static final long serialVersionUID = 1003888396256744753L;
-
- /** Point coordinates. */
- private final double[] point;
-
- /** Vectorial value of the objective function at the point. */
- private final double[] value;
-
- /** Build a point/objective function value pair.
- * @param point point coordinates (the built instance will store
- * a copy of the array, not the array passed as argument)
- * @param value value of an objective function at the point
- */
- public VectorialPointValuePair(final double[] point, final double[] value)
{
- this.point = (point == null) ? null : point.clone();
- this.value = (value == null) ? null : value.clone();
- }
-
- /** Build a point/objective function value pair.
- * @param point point coordinates (the built instance will store
- * a copy of the array, not the array passed as argument)
- * @param value value of an objective function at the point
- * @param copyArray if true, the input arrays will be copied, otherwise
- * they will be referenced
- */
- public VectorialPointValuePair(final double[] point, final double[] value,
- final boolean copyArray) {
- this.point = copyArray ?
- ((point == null) ? null : point.clone()) :
- point;
- this.value = copyArray ?
- ((value == null) ? null : value.clone()) :
- value;
- }
-
- /** Get the point.
- * @return a copy of the stored point
+public class PointVectorValuePair extends Pair<double[], double[]> {
+ /**
+ * Builds a point/objective function value pair.
+ *
+ * @param point Point coordinates. This instance will store
+ * a copy of the array, not the array passed as argument.
+ * @param value Value of the objective function at the point.
+ */
+ public PointVectorValuePair(final double[] point,
+ final double[] value) {
+ this(point, value, true);
+ }
+
+ /**
+ * Build a point/objective function value pair.
+ *
+ * @param point Point coordinates.
+ * @param value Value of the objective function at the point.
+ * @param copyArray if {@code true}, the input arrays will be copied,
+ * otherwise they will be referenced.
+ */
+ public PointVectorValuePair(final double[] point,
+ final double[] value,
+ final boolean copyArray) {
+ super(copyArray ?
+ ((point == null) ? null :
+ point.clone()) :
+ point,
+ copyArray ?
+ ((value == null) ? null :
+ value.clone()) :
+ value);
+ }
+
+ /**
+ * Gets the point.
+ *
+ * @return a copy of the stored point.
*/
public double[] getPoint() {
- return (point == null) ? null : point.clone();
+ final double[] p = getKey();
+ return p == null ? null : p.clone();
}
- /** Get a reference to the point.
- * <p>This method is provided as a convenience to avoid copying
- * the array, the elements of the array should <em>not</em> be
modified.</p>
- * @return a reference to the internal array storing the point
+ /**
+ * Gets a reference to the point.
+ *
+ * @return a reference to the internal array storing the point.
*/
public double[] getPointRef() {
- return point;
+ return getKey();
}
- /** Get the value of the objective function.
- * @return a copy of the stored value of the objective function
+ /**
+ * Gets the value of the objective function.
+ *
+ * @return a copy of the stored value of the objective function.
*/
+ @Override
public double[] getValue() {
- return (value == null) ? null : value.clone();
+ final double[] v = super.getValue();
+ return v == null ? null : v.clone();
}
- /** Get a reference to the value of the objective function.
- * <p>This method is provided as a convenience to avoid copying
- * the array, the elements of the array should <em>not</em> be
modified.</p>
- * @return a reference to the internal array storing the value of the
objective function
+ /**
+ * Gets a reference to the value of the objective function.
+ *
+ * @return a reference to the internal array storing the value of
+ * the objective function.
*/
public double[] getValueRef() {
- return value;
+ return super.getValue();
}
-
}
Modified:
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/SimpleVectorialPointChecker.java
URL:
http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/SimpleVectorialPointChecker.java?rev=1243310&r1=1243309&r2=1243310&view=diff
==============================================================================
---
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/SimpleVectorialPointChecker.java
(original)
+++
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/SimpleVectorialPointChecker.java
Sun Feb 12 20:00:31 2012
@@ -30,7 +30,7 @@ package org.apache.commons.math.optimiza
* @since 3.0
*/
public class SimpleVectorialPointChecker
- extends AbstractConvergenceChecker<VectorialPointValuePair> {
+ extends AbstractConvergenceChecker<PointVectorValuePair> {
/**
* Build an instance with default threshold.
*/
@@ -69,8 +69,8 @@ public class SimpleVectorialPointChecker
*/
@Override
public boolean converged(final int iteration,
- final VectorialPointValuePair previous,
- final VectorialPointValuePair current) {
+ final PointVectorValuePair previous,
+ final PointVectorValuePair current) {
final double[] p = previous.getPointRef();
final double[] c = current.getPointRef();
for (int i = 0; i < p.length; ++i) {
Modified:
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/SimpleVectorialValueChecker.java
URL:
http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/SimpleVectorialValueChecker.java?rev=1243310&r1=1243309&r2=1243310&view=diff
==============================================================================
---
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/SimpleVectorialValueChecker.java
(original)
+++
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/SimpleVectorialValueChecker.java
Sun Feb 12 20:00:31 2012
@@ -32,7 +32,7 @@ import org.apache.commons.math.util.Fast
* @since 3.0
*/
public class SimpleVectorialValueChecker
- extends AbstractConvergenceChecker<VectorialPointValuePair> {
+ extends AbstractConvergenceChecker<PointVectorValuePair> {
/**
* Build an instance with default thresholds.
*/
@@ -71,8 +71,8 @@ public class SimpleVectorialValueChecker
*/
@Override
public boolean converged(final int iteration,
- final VectorialPointValuePair previous,
- final VectorialPointValuePair current) {
+ final PointVectorValuePair previous,
+ final PointVectorValuePair current) {
final double[] p = previous.getValueRef();
final double[] c = current.getValueRef();
for (int i = 0; i < p.length; ++i) {
Modified:
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/VectorialConvergenceChecker.java
URL:
http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/VectorialConvergenceChecker.java?rev=1243310&r1=1243309&r2=1243310&view=diff
==============================================================================
---
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/VectorialConvergenceChecker.java
(original)
+++
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/VectorialConvergenceChecker.java
Sun Feb 12 20:00:31 2012
@@ -50,6 +50,6 @@ public interface VectorialConvergenceChe
* @param current point from current iteration
* @return true if the algorithm is considered to have converged
*/
- boolean converged(int iteration, VectorialPointValuePair previous,
VectorialPointValuePair current);
+ boolean converged(int iteration, PointVectorValuePair previous,
PointVectorValuePair current);
}
Modified:
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/BaseAbstractMultivariateVectorOptimizer.java
URL:
http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/BaseAbstractMultivariateVectorOptimizer.java?rev=1243310&r1=1243309&r2=1243310&view=diff
==============================================================================
---
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/BaseAbstractMultivariateVectorOptimizer.java
(original)
+++
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/BaseAbstractMultivariateVectorOptimizer.java
Sun Feb 12 20:00:31 2012
@@ -25,7 +25,7 @@ import org.apache.commons.math.exception
import org.apache.commons.math.analysis.MultivariateVectorFunction;
import org.apache.commons.math.optimization.BaseMultivariateVectorOptimizer;
import org.apache.commons.math.optimization.ConvergenceChecker;
-import org.apache.commons.math.optimization.VectorialPointValuePair;
+import org.apache.commons.math.optimization.PointVectorValuePair;
import org.apache.commons.math.optimization.SimpleVectorialValueChecker;
/**
@@ -43,7 +43,7 @@ public abstract class BaseAbstractMultiv
/** Evaluations counter. */
protected final Incrementor evaluations = new Incrementor();
/** Convergence checker. */
- private ConvergenceChecker<VectorialPointValuePair> checker;
+ private ConvergenceChecker<PointVectorValuePair> checker;
/** Target value for the objective functions at optimum. */
private double[] target;
/** Weight for the least squares cost computation. */
@@ -64,7 +64,7 @@ public abstract class BaseAbstractMultiv
/**
* @param checker Convergence checker.
*/
- protected
BaseAbstractMultivariateVectorOptimizer(ConvergenceChecker<VectorialPointValuePair>
checker) {
+ protected
BaseAbstractMultivariateVectorOptimizer(ConvergenceChecker<PointVectorValuePair>
checker) {
this.checker = checker;
}
@@ -79,7 +79,7 @@ public abstract class BaseAbstractMultiv
}
/** {@inheritDoc} */
- public ConvergenceChecker<VectorialPointValuePair> getConvergenceChecker()
{
+ public ConvergenceChecker<PointVectorValuePair> getConvergenceChecker() {
return checker;
}
@@ -101,7 +101,7 @@ public abstract class BaseAbstractMultiv
}
/** {@inheritDoc} */
- public VectorialPointValuePair optimize(int maxEval, FUNC f, double[] t,
double[] w,
+ public PointVectorValuePair optimize(int maxEval, FUNC f, double[] t,
double[] w,
double[] startPoint) {
// Checks.
if (f == null) {
@@ -147,7 +147,7 @@ public abstract class BaseAbstractMultiv
* @return the point/value pair giving the optimal value for the
* objective function.
*/
- protected abstract VectorialPointValuePair doOptimize();
+ protected abstract PointVectorValuePair doOptimize();
/**
* @return a reference to the {@link #target array}.
Modified:
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/fitting/CurveFitter.java
URL:
http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/fitting/CurveFitter.java?rev=1243310&r1=1243309&r2=1243310&view=diff
==============================================================================
---
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/fitting/CurveFitter.java
(original)
+++
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/fitting/CurveFitter.java
Sun Feb 12 20:00:31 2012
@@ -24,7 +24,7 @@ import org.apache.commons.math.analysis.
import org.apache.commons.math.analysis.ParametricUnivariateFunction;
import org.apache.commons.math.analysis.MultivariateMatrixFunction;
import
org.apache.commons.math.optimization.DifferentiableMultivariateVectorOptimizer;
-import org.apache.commons.math.optimization.VectorialPointValuePair;
+import org.apache.commons.math.optimization.PointVectorValuePair;
/** Fitter for parametric univariate real functions y = f(x).
* <p>When a univariate real function y = f(x) does depend on some
@@ -154,7 +154,7 @@ public class CurveFitter {
}
// perform the fit
- VectorialPointValuePair optimum =
+ PointVectorValuePair optimum =
optimizer.optimize(maxEval, new TheoreticalValuesFunction(f),
target, weights, initialGuess);
Modified:
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/AbstractLeastSquaresOptimizer.java
URL:
http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/AbstractLeastSquaresOptimizer.java?rev=1243310&r1=1243309&r2=1243310&view=diff
==============================================================================
---
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/AbstractLeastSquaresOptimizer.java
(original)
+++
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/AbstractLeastSquaresOptimizer.java
Sun Feb 12 20:00:31 2012
@@ -27,7 +27,7 @@ import org.apache.commons.math.linear.De
import org.apache.commons.math.linear.MatrixUtils;
import org.apache.commons.math.optimization.ConvergenceChecker;
import
org.apache.commons.math.optimization.DifferentiableMultivariateVectorOptimizer;
-import org.apache.commons.math.optimization.VectorialPointValuePair;
+import org.apache.commons.math.optimization.PointVectorValuePair;
import
org.apache.commons.math.optimization.direct.BaseAbstractMultivariateVectorOptimizer;
import org.apache.commons.math.util.FastMath;
@@ -89,7 +89,7 @@ public abstract class AbstractLeastSquar
/**
* @param checker Convergence checker.
*/
- protected
AbstractLeastSquaresOptimizer(ConvergenceChecker<VectorialPointValuePair>
checker) {
+ protected
AbstractLeastSquaresOptimizer(ConvergenceChecker<PointVectorValuePair> checker)
{
super(checker);
}
@@ -252,7 +252,7 @@ public abstract class AbstractLeastSquar
/** {@inheritDoc} */
@Override
- public VectorialPointValuePair optimize(int maxEval,
+ public PointVectorValuePair optimize(int maxEval,
final
DifferentiableMultivariateVectorFunction f,
final double[] target, final
double[] weights,
final double[] startPoint) {
Modified:
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/GaussNewtonOptimizer.java
URL:
http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/GaussNewtonOptimizer.java?rev=1243310&r1=1243309&r2=1243310&view=diff
==============================================================================
---
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/GaussNewtonOptimizer.java
(original)
+++
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/GaussNewtonOptimizer.java
Sun Feb 12 20:00:31 2012
@@ -28,7 +28,7 @@ import org.apache.commons.math.linear.Re
import org.apache.commons.math.linear.SingularMatrixException;
import org.apache.commons.math.optimization.ConvergenceChecker;
import org.apache.commons.math.optimization.SimpleVectorialValueChecker;
-import org.apache.commons.math.optimization.VectorialPointValuePair;
+import org.apache.commons.math.optimization.PointVectorValuePair;
/**
* Gauss-Newton least-squares solver.
@@ -64,7 +64,7 @@ public class GaussNewtonOptimizer extend
*
* @param checker Convergence checker.
*/
- public GaussNewtonOptimizer(ConvergenceChecker<VectorialPointValuePair>
checker) {
+ public GaussNewtonOptimizer(ConvergenceChecker<PointVectorValuePair>
checker) {
this(true, checker);
}
@@ -88,29 +88,29 @@ public class GaussNewtonOptimizer extend
* @param checker Convergence checker.
*/
public GaussNewtonOptimizer(final boolean useLU,
- ConvergenceChecker<VectorialPointValuePair>
checker) {
+ ConvergenceChecker<PointVectorValuePair>
checker) {
super(checker);
this.useLU = useLU;
}
/** {@inheritDoc} */
@Override
- public VectorialPointValuePair doOptimize() {
+ public PointVectorValuePair doOptimize() {
- final ConvergenceChecker<VectorialPointValuePair> checker
+ final ConvergenceChecker<PointVectorValuePair> checker
= getConvergenceChecker();
// iterate until convergence is reached
- VectorialPointValuePair current = null;
+ PointVectorValuePair current = null;
int iter = 0;
for (boolean converged = false; !converged;) {
++iter;
// evaluate the objective function and its jacobian
- VectorialPointValuePair previous = current;
+ PointVectorValuePair previous = current;
updateResidualsAndCost();
updateJacobian();
- current = new VectorialPointValuePair(point, objective);
+ current = new PointVectorValuePair(point, objective);
final double[] targetValues = getTargetRef();
final double[] residualsWeights = getWeightRef();
Modified:
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/LevenbergMarquardtOptimizer.java
URL:
http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/LevenbergMarquardtOptimizer.java?rev=1243310&r1=1243309&r2=1243310&view=diff
==============================================================================
---
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/LevenbergMarquardtOptimizer.java
(original)
+++
commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/general/LevenbergMarquardtOptimizer.java
Sun Feb 12 20:00:31 2012
@@ -20,7 +20,7 @@ import java.util.Arrays;
import org.apache.commons.math.exception.ConvergenceException;
import org.apache.commons.math.exception.util.LocalizedFormats;
-import org.apache.commons.math.optimization.VectorialPointValuePair;
+import org.apache.commons.math.optimization.PointVectorValuePair;
import org.apache.commons.math.optimization.ConvergenceChecker;
import org.apache.commons.math.util.Precision;
import org.apache.commons.math.util.FastMath;
@@ -166,7 +166,7 @@ public class LevenbergMarquardtOptimizer
*
* @param checker Convergence checker.
*/
- public
LevenbergMarquardtOptimizer(ConvergenceChecker<VectorialPointValuePair>
checker) {
+ public
LevenbergMarquardtOptimizer(ConvergenceChecker<PointVectorValuePair> checker) {
this(100, checker, 1e-10, 1e-10, 1e-10, Precision.SAFE_MIN);
}
@@ -193,7 +193,7 @@ public class LevenbergMarquardtOptimizer
* of the matrix is reduced.
*/
public LevenbergMarquardtOptimizer(double initialStepBoundFactor,
-
ConvergenceChecker<VectorialPointValuePair> checker,
+
ConvergenceChecker<PointVectorValuePair> checker,
double costRelativeTolerance,
double parRelativeTolerance,
double orthoTolerance,
@@ -269,7 +269,7 @@ public class LevenbergMarquardtOptimizer
/** {@inheritDoc} */
@Override
- protected VectorialPointValuePair doOptimize() {
+ protected PointVectorValuePair doOptimize() {
// arrays shared with the other private methods
solvedCols = FastMath.min(rows, cols);
diagR = new double[cols];
@@ -296,9 +296,9 @@ public class LevenbergMarquardtOptimizer
// outer loop
lmPar = 0;
boolean firstIteration = true;
- VectorialPointValuePair current = new VectorialPointValuePair(point,
objective);
+ PointVectorValuePair current = new PointVectorValuePair(point,
objective);
int iter = 0;
- final ConvergenceChecker<VectorialPointValuePair> checker =
getConvergenceChecker();
+ final ConvergenceChecker<PointVectorValuePair> checker =
getConvergenceChecker();
while (true) {
++iter;
@@ -307,7 +307,7 @@ public class LevenbergMarquardtOptimizer
}
// compute the Q.R. decomposition of the jacobian matrix
- VectorialPointValuePair previous = current;
+ PointVectorValuePair previous = current;
updateJacobian();
qrDecomposition();
@@ -357,7 +357,7 @@ public class LevenbergMarquardtOptimizer
if (maxCosine <= orthoTolerance) {
// convergence has been reached
updateResidualsAndCost();
- current = new VectorialPointValuePair(point, objective);
+ current = new PointVectorValuePair(point, objective);
return current;
}
@@ -457,7 +457,7 @@ public class LevenbergMarquardtOptimizer
xNorm += xK * xK;
}
xNorm = FastMath.sqrt(xNorm);
- current = new VectorialPointValuePair(point, objective);
+ current = new PointVectorValuePair(point, objective);
// tests for convergence.
if (checker != null) {
Modified:
commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/DifferentiableMultivariateVectorMultiStartOptimizerTest.java
URL:
http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/DifferentiableMultivariateVectorMultiStartOptimizerTest.java?rev=1243310&r1=1243309&r2=1243310&view=diff
==============================================================================
---
commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/DifferentiableMultivariateVectorMultiStartOptimizerTest.java
(original)
+++
commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/DifferentiableMultivariateVectorMultiStartOptimizerTest.java
Sun Feb 12 20:00:31 2012
@@ -117,11 +117,11 @@ public class DifferentiableMultivariateV
} catch (MathIllegalStateException ise) {
// expected
}
- VectorialPointValuePair optimum =
+ PointVectorValuePair optimum =
optimizer.optimize(100, problem, problem.target, new double[] { 1
}, new double[] { 0 });
Assert.assertEquals(1.5, optimum.getPoint()[0], 1.0e-10);
Assert.assertEquals(3.0, optimum.getValue()[0], 1.0e-10);
- VectorialPointValuePair[] optima = optimizer.getOptima();
+ PointVectorValuePair[] optima = optimizer.getOptima();
Assert.assertEquals(10, optima.length);
for (int i = 0; i < optima.length; ++i) {
Assert.assertEquals(1.5, optima[i].getPoint()[0], 1.0e-10);
Modified:
commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/GaussNewtonOptimizerTest.java
URL:
http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/GaussNewtonOptimizerTest.java?rev=1243310&r1=1243309&r2=1243310&view=diff
==============================================================================
---
commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/GaussNewtonOptimizerTest.java
(original)
+++
commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/GaussNewtonOptimizerTest.java
Sun Feb 12 20:00:31 2012
@@ -30,7 +30,7 @@ import org.apache.commons.math.analysis.
import org.apache.commons.math.linear.BlockRealMatrix;
import org.apache.commons.math.linear.RealMatrix;
import org.apache.commons.math.optimization.SimpleVectorialValueChecker;
-import org.apache.commons.math.optimization.VectorialPointValuePair;
+import org.apache.commons.math.optimization.PointVectorValuePair;
import org.apache.commons.math.util.FastMath;
import org.junit.Assert;
import org.junit.Test;
@@ -107,7 +107,7 @@ public class GaussNewtonOptimizerTest {
GaussNewtonOptimizer optimizer
= new GaussNewtonOptimizer(new SimpleVectorialValueChecker(1.0e-6,
1.0e-6));
- VectorialPointValuePair optimum =
+ PointVectorValuePair optimum =
optimizer.optimize(100, problem, problem.target, new double[] { 1
}, new double[] { 0 });
Assert.assertEquals(0, optimizer.getRMS(), 1.0e-10);
Assert.assertEquals(1.5, optimum.getPoint()[0], 1.0e-10);
@@ -124,7 +124,7 @@ public class GaussNewtonOptimizerTest {
GaussNewtonOptimizer optimizer
= new GaussNewtonOptimizer(new SimpleVectorialValueChecker(1.0e-6,
1.0e-6));
- VectorialPointValuePair optimum =
+ PointVectorValuePair optimum =
optimizer.optimize(100, problem, problem.target, new double[] { 1,
1, 1 }, new double[] { 0, 0 });
Assert.assertEquals(0, optimizer.getRMS(), 1.0e-10);
Assert.assertEquals(7.0, optimum.getPoint()[0], 1.0e-10);
@@ -149,7 +149,7 @@ public class GaussNewtonOptimizerTest {
GaussNewtonOptimizer optimizer
= new GaussNewtonOptimizer(new SimpleVectorialValueChecker(1.0e-6,
1.0e-6));
- VectorialPointValuePair optimum =
+ PointVectorValuePair optimum =
optimizer.optimize(100, problem, problem.target, new double[] { 1,
1, 1, 1, 1, 1 },
new double[] { 0, 0, 0, 0, 0, 0 });
Assert.assertEquals(0, optimizer.getRMS(), 1.0e-10);
@@ -170,7 +170,7 @@ public class GaussNewtonOptimizerTest {
GaussNewtonOptimizer optimizer
= new GaussNewtonOptimizer(new SimpleVectorialValueChecker(1.0e-6,
1.0e-6));
- VectorialPointValuePair optimum =
+ PointVectorValuePair optimum =
optimizer.optimize(100, problem, problem.target, new double[] { 1,
1, 1 }, new double[] { 0, 0, 0 });
Assert.assertEquals(0, optimizer.getRMS(), 1.0e-10);
Assert.assertEquals(1.0, optimum.getPoint()[0], 1.0e-10);
@@ -194,7 +194,7 @@ public class GaussNewtonOptimizerTest {
GaussNewtonOptimizer optimizer
= new GaussNewtonOptimizer(new SimpleVectorialValueChecker(1.0e-6,
1.0e-6));
- VectorialPointValuePair optimum =
+ PointVectorValuePair optimum =
optimizer.optimize(100, problem, problem.target, new double[] { 1,
1, 1, 1, 1, 1 },
new double[] { 0, 0, 0, 0, 0, 0 });
Assert.assertEquals(0, optimizer.getRMS(), 1.0e-10);
@@ -234,7 +234,7 @@ public class GaussNewtonOptimizerTest {
GaussNewtonOptimizer optimizer
= new GaussNewtonOptimizer(new SimpleVectorialValueChecker(1.0e-6,
1.0e-6));
- VectorialPointValuePair optimum1 =
+ PointVectorValuePair optimum1 =
optimizer.optimize(100, problem1, problem1.target, new double[] {
1, 1, 1, 1 },
new double[] { 0, 1, 2, 3 });
Assert.assertEquals(0, optimizer.getRMS(), 1.0e-10);
@@ -249,7 +249,7 @@ public class GaussNewtonOptimizerTest {
{ 8.00, 5.98, 9.89, 9.00 },
{ 6.99, 4.99, 9.00, 9.98 }
}, new double[] { 32, 23, 33, 31 });
- VectorialPointValuePair optimum2 =
+ PointVectorValuePair optimum2 =
optimizer.optimize(100, problem2, problem2.target, new double[] {
1, 1, 1, 1 },
new double[] { 0, 1, 2, 3 });
Assert.assertEquals(0, optimizer.getRMS(), 1.0e-10);
@@ -304,7 +304,7 @@ public class GaussNewtonOptimizerTest {
GaussNewtonOptimizer optimizer
= new GaussNewtonOptimizer(new SimpleVectorialValueChecker(1.0e-6,
1.0e-6));
- VectorialPointValuePair optimum =
+ PointVectorValuePair optimum =
optimizer.optimize(100, problem, problem.target, new double[] { 1,
1, 1 },
new double[] { 1, 1 });
Assert.assertEquals(0, optimizer.getRMS(), 1.0e-10);
@@ -336,7 +336,7 @@ public class GaussNewtonOptimizerTest {
GaussNewtonOptimizer optimizer
= new GaussNewtonOptimizer(new SimpleVectorialValueChecker(1.0e-6,
1.0e-6));
- VectorialPointValuePair optimum =
+ PointVectorValuePair optimum =
optimizer.optimize(100, problem, problem.target, new double[] { 1,
1 }, new double[] { 0, 0 });
Assert.assertEquals(0, optimizer.getRMS(), 1.0e-10);
Assert.assertEquals(-1, optimum.getPoint()[0], 1.0e-10);
@@ -355,7 +355,7 @@ public class GaussNewtonOptimizerTest {
GaussNewtonOptimizer optimizer
= new GaussNewtonOptimizer(new SimpleVectorialValueChecker(1.0e-6,
1.0e-6));
- VectorialPointValuePair optimum =
+ PointVectorValuePair optimum =
optimizer.optimize(100, problem, problem.target, new double[] { 1,
1 }, new double[] { 0, 0 });
Assert.assertEquals(0, optimizer.getRMS(), 1.0e-10);
Assert.assertEquals(-1, optimum.getPoint()[0], 1.0e-10);
@@ -395,7 +395,7 @@ public class GaussNewtonOptimizerTest {
GaussNewtonOptimizer optimizer
= new GaussNewtonOptimizer(new
SimpleVectorialValueChecker(1.0e-13, 1.0e-13));
- VectorialPointValuePair optimum =
+ PointVectorValuePair optimum =
optimizer.optimize(100, circle, new double[] { 0, 0, 0, 0, 0 },
new double[] { 1, 1, 1, 1, 1 },
new double[] { 98.680, 47.345 });
@@ -439,7 +439,7 @@ public class GaussNewtonOptimizerTest {
GaussNewtonOptimizer optimizer
= new GaussNewtonOptimizer(new SimpleVectorialValueChecker(1.0e-6,
1.0e-6));
- VectorialPointValuePair optimum =
+ PointVectorValuePair optimum =
optimizer.optimize(100, circle, target, weights, new double[] { 0,
0 });
Assert.assertEquals(-0.1517383071957963, optimum.getPointRef()[0],
1.0e-6);
Assert.assertEquals(0.2074999736353867, optimum.getPointRef()[1],
1.0e-6);
Modified:
commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/LevenbergMarquardtOptimizerTest.java
URL:
http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/LevenbergMarquardtOptimizerTest.java?rev=1243310&r1=1243309&r2=1243310&view=diff
==============================================================================
---
commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/LevenbergMarquardtOptimizerTest.java
(original)
+++
commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/LevenbergMarquardtOptimizerTest.java
Sun Feb 12 20:00:31 2012
@@ -34,7 +34,7 @@ import org.apache.commons.math.linear.Bl
import org.apache.commons.math.linear.RealMatrix;
import org.apache.commons.math.linear.SingularMatrixException;
import org.apache.commons.math.optimization.SimpleVectorialValueChecker;
-import org.apache.commons.math.optimization.VectorialPointValuePair;
+import org.apache.commons.math.optimization.PointVectorValuePair;
import org.apache.commons.math.util.Precision;
import org.apache.commons.math.util.FastMath;
import org.junit.Assert;
@@ -109,7 +109,7 @@ public class LevenbergMarquardtOptimizer
LinearProblem problem =
new LinearProblem(new double[][] { { 2 } }, new double[] { 3 });
LevenbergMarquardtOptimizer optimizer = new
LevenbergMarquardtOptimizer();
- VectorialPointValuePair optimum =
+ PointVectorValuePair optimum =
optimizer.optimize(100, problem, problem.target, new double[] { 1
}, new double[] { 0 });
Assert.assertEquals(0, optimizer.getRMS(), 1.0e-10);
try {
@@ -130,7 +130,7 @@ public class LevenbergMarquardtOptimizer
new double[] { 4.0, 6.0, 1.0 });
LevenbergMarquardtOptimizer optimizer = new
LevenbergMarquardtOptimizer();
- VectorialPointValuePair optimum =
+ PointVectorValuePair optimum =
optimizer.optimize(100, problem, problem.target, new double[] { 1,
1, 1 }, new double[] { 0, 0 });
Assert.assertEquals(0, optimizer.getRMS(), 1.0e-10);
Assert.assertEquals(7.0, optimum.getPoint()[0], 1.0e-10);
@@ -151,7 +151,7 @@ public class LevenbergMarquardtOptimizer
{ 0, 0, 0, 0, 0, 2 }
}, new double[] { 0.0, 1.1, 2.2, 3.3, 4.4, 5.5 });
LevenbergMarquardtOptimizer optimizer = new
LevenbergMarquardtOptimizer();
- VectorialPointValuePair optimum =
+ PointVectorValuePair optimum =
optimizer.optimize(100, problem, problem.target, new double[] { 1,
1, 1, 1, 1, 1 },
new double[] { 0, 0, 0, 0, 0, 0 });
Assert.assertEquals(0, optimizer.getRMS(), 1.0e-10);
@@ -169,7 +169,7 @@ public class LevenbergMarquardtOptimizer
{ 0, -1, 1 }
}, new double[] { 1, 1, 1});
LevenbergMarquardtOptimizer optimizer = new
LevenbergMarquardtOptimizer();
- VectorialPointValuePair optimum =
+ PointVectorValuePair optimum =
optimizer.optimize(100, problem, problem.target, new double[] { 1,
1, 1 }, new double[] { 0, 0, 0 });
Assert.assertEquals(0, optimizer.getRMS(), 1.0e-10);
Assert.assertEquals(1.0, optimum.getPoint()[0], 1.0e-10);
@@ -190,7 +190,7 @@ public class LevenbergMarquardtOptimizer
}, new double[] { 2, -9, 2, 2, 1 + epsilon * epsilon, 2});
LevenbergMarquardtOptimizer optimizer = new
LevenbergMarquardtOptimizer();
- VectorialPointValuePair optimum =
+ PointVectorValuePair optimum =
optimizer.optimize(100, problem, problem.target, new double[] { 1,
1, 1, 1, 1, 1 },
new double[] { 0, 0, 0, 0, 0, 0 });
Assert.assertEquals(0, optimizer.getRMS(), 1.0e-10);
@@ -230,7 +230,7 @@ public class LevenbergMarquardtOptimizer
{ 7.0, 5.0, 9.0, 10.0 }
}, new double[] { 32, 23, 33, 31 });
LevenbergMarquardtOptimizer optimizer = new
LevenbergMarquardtOptimizer();
- VectorialPointValuePair optimum1 =
+ PointVectorValuePair optimum1 =
optimizer.optimize(100, problem1, problem1.target, new double[] {
1, 1, 1, 1 },
new double[] { 0, 1, 2, 3 });
Assert.assertEquals(0, optimizer.getRMS(), 1.0e-10);
@@ -245,7 +245,7 @@ public class LevenbergMarquardtOptimizer
{ 8.00, 5.98, 9.89, 9.00 },
{ 6.99, 4.99, 9.00, 9.98 }
}, new double[] { 32, 23, 33, 31 });
- VectorialPointValuePair optimum2 =
+ PointVectorValuePair optimum2 =
optimizer.optimize(100, problem2, problem2.target, new double[] {
1, 1, 1, 1 },
new double[] { 0, 1, 2, 3 });
Assert.assertEquals(0, optimizer.getRMS(), 1.0e-10);
@@ -281,7 +281,7 @@ public class LevenbergMarquardtOptimizer
}, new double[] { 3.0, 12.0, -1.0, 7.0, 1.0 });
LevenbergMarquardtOptimizer optimizer = new
LevenbergMarquardtOptimizer();
- VectorialPointValuePair optimum =
+ PointVectorValuePair optimum =
optimizer.optimize(100, problem, problem.target, new double[] { 1,
1, 1, 1, 1 },
new double[] { 2, 2, 2, 2, 2, 2 });
Assert.assertEquals(0, optimizer.getRMS(), 1.0e-10);
@@ -300,7 +300,7 @@ public class LevenbergMarquardtOptimizer
}, new double[] { 3.0, 1.0, 5.0 });
LevenbergMarquardtOptimizer optimizer = new
LevenbergMarquardtOptimizer();
- VectorialPointValuePair optimum =
+ PointVectorValuePair optimum =
optimizer.optimize(100, problem, problem.target, new double[] { 1,
1, 1 },
new double[] { 1, 1 });
Assert.assertEquals(0, optimizer.getRMS(), 1.0e-10);
@@ -327,7 +327,7 @@ public class LevenbergMarquardtOptimizer
new LinearProblem(new double[][] { { 1, 0 }, { 0, 1 } }, new
double[] { -1, 1 });
LevenbergMarquardtOptimizer optimizer = new
LevenbergMarquardtOptimizer();
- VectorialPointValuePair optimum =
+ PointVectorValuePair optimum =
optimizer.optimize(100, problem, problem.target, new double[] { 1,
1 }, new double[] { 0, 0 });
Assert.assertEquals(0, optimizer.getRMS(), 1.0e-10);
Assert.assertEquals(-1, optimum.getPoint()[0], 1.0e-10);
@@ -398,7 +398,7 @@ public class LevenbergMarquardtOptimizer
circle.addPoint( 35.0, 15.0);
circle.addPoint( 45.0, 97.0);
LevenbergMarquardtOptimizer optimizer = new
LevenbergMarquardtOptimizer();
- VectorialPointValuePair optimum =
+ PointVectorValuePair optimum =
optimizer.optimize(100, circle, new double[] { 0, 0, 0, 0, 0 },
new double[] { 1, 1, 1, 1, 1 },
new double[] { 98.680, 47.345 });
Assert.assertTrue(optimizer.getEvaluations() < 10);
@@ -481,7 +481,7 @@ public class LevenbergMarquardtOptimizer
}
LevenbergMarquardtOptimizer optimizer
= new LevenbergMarquardtOptimizer(new
SimpleVectorialValueChecker(1.0e-8, 1.0e-8));
- VectorialPointValuePair optimum =
+ PointVectorValuePair optimum =
optimizer.optimize(100, circle, target, weights, new double[] {
-12, -12 });
Point2D.Double center = new Point2D.Double(optimum.getPointRef()[0],
optimum.getPointRef()[1]);
Assert.assertTrue(optimizer.getEvaluations() < 25);
Modified:
commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/MinpackTest.java
URL:
http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/MinpackTest.java?rev=1243310&r1=1243309&r2=1243310&view=diff
==============================================================================
---
commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/MinpackTest.java
(original)
+++
commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/MinpackTest.java
Sun Feb 12 20:00:31 2012
@@ -24,7 +24,7 @@ import java.util.Arrays;
import org.apache.commons.math.exception.TooManyEvaluationsException;
import
org.apache.commons.math.analysis.DifferentiableMultivariateVectorFunction;
import org.apache.commons.math.analysis.MultivariateMatrixFunction;
-import org.apache.commons.math.optimization.VectorialPointValuePair;
+import org.apache.commons.math.optimization.PointVectorValuePair;
import org.apache.commons.math.util.FastMath;
import org.junit.Assert;
import org.junit.Test;
@@ -509,7 +509,7 @@ public class MinpackTest {
2.22044604926e-16);
//
Assert.assertTrue(function.checkTheoreticalStartCost(optimizer.getRMS()));
try {
- VectorialPointValuePair optimum =
+ PointVectorValuePair optimum =
optimizer.optimize(400 * (function.getN() + 1), function,
function.getTarget(), function.getWeight(),
function.getStartPoint());
@@ -579,7 +579,7 @@ public class MinpackTest {
Assert.assertEquals(theoreticalMinCost, FastMath.sqrt(m) * rms,
threshold);
}
- public void checkTheoreticalMinParams(VectorialPointValuePair optimum) {
+ public void checkTheoreticalMinParams(PointVectorValuePair optimum) {
double[] params = optimum.getPointRef();
if (theoreticalMinParams != null) {
for (int i = 0; i < theoreticalMinParams.length; ++i) {