Class name change:
  "MultiStartDifferentiableMultivariateVectorialOptimizer" -> "DifferentiableMultivariateVectorMultiStartOptimizer"
  "DifferentiableMultivariateVectorialOptimizer" -> "DifferentiableMultivariateVectorOptimizer"
  "BaseMultiStartMultivariateVectorialOptimizer" -> "BaseMultivariateVectorMultiStartOptimizer"
  "BaseMultivariateVectorialOptimizer" -> "BaseMultivariateVectorOptimizer"


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1212361 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gilles Sadowski 2011-12-09 12:22:10 +00:00
parent bb322e8ffb
commit 497d025e1e
17 changed files with 44 additions and 44 deletions

View File

@ -33,17 +33,17 @@ import org.apache.commons.math.random.RandomVectorGenerator;
* *
* This interface is mainly intended to enforce the internal coherence of * This interface is mainly intended to enforce the internal coherence of
* Commons-Math. Users of the API are advised to base their code on * Commons-Math. Users of the API are advised to base their code on
* {@link MultiStartDifferentiableMultivariateVectorialOptimizer}. * {@link DifferentiableMultivariateVectorMultiStartOptimizer}.
* *
* @param <FUNC> Type of the objective function to be optimized. * @param <FUNC> Type of the objective function to be optimized.
* *
* @version $Id$ * @version $Id$
* @since 3.0 * @since 3.0
*/ */
public class BaseMultiStartMultivariateVectorialOptimizer<FUNC extends MultivariateVectorFunction> public class BaseMultivariateVectorMultiStartOptimizer<FUNC extends MultivariateVectorFunction>
implements BaseMultivariateVectorialOptimizer<FUNC> { implements BaseMultivariateVectorOptimizer<FUNC> {
/** Underlying classical optimizer. */ /** Underlying classical optimizer. */
private final BaseMultivariateVectorialOptimizer<FUNC> optimizer; private final BaseMultivariateVectorOptimizer<FUNC> optimizer;
/** Maximal number of evaluations allowed. */ /** Maximal number of evaluations allowed. */
private int maxEvaluations; private int maxEvaluations;
/** Number of evaluations already performed for all starts. */ /** Number of evaluations already performed for all starts. */
@ -67,7 +67,7 @@ public class BaseMultiStartMultivariateVectorialOptimizer<FUNC extends Multivari
* is {@code null}. * is {@code null}.
* @throws NotStrictlyPositiveException if {@code starts < 1}. * @throws NotStrictlyPositiveException if {@code starts < 1}.
*/ */
protected BaseMultiStartMultivariateVectorialOptimizer(final BaseMultivariateVectorialOptimizer<FUNC> optimizer, protected BaseMultivariateVectorMultiStartOptimizer(final BaseMultivariateVectorOptimizer<FUNC> optimizer,
final int starts, final int starts,
final RandomVectorGenerator generator) { final RandomVectorGenerator generator) {
if (optimizer == null || if (optimizer == null ||

View File

@ -24,7 +24,7 @@ import org.apache.commons.math.analysis.MultivariateVectorFunction;
* Commons-Math. Users of the API are advised to base their code on * Commons-Math. Users of the API are advised to base their code on
* the following interfaces: * the following interfaces:
* <ul> * <ul>
* <li>{@link org.apache.commons.math.optimization.DifferentiableMultivariateVectorialOptimizer}</li> * <li>{@link org.apache.commons.math.optimization.DifferentiableMultivariateVectorOptimizer}</li>
* </ul> * </ul>
* *
* @param <FUNC> Type of the objective function to be optimized. * @param <FUNC> Type of the objective function to be optimized.
@ -32,7 +32,7 @@ import org.apache.commons.math.analysis.MultivariateVectorFunction;
* @version $Id$ * @version $Id$
* @since 3.0 * @since 3.0
*/ */
public interface BaseMultivariateVectorialOptimizer<FUNC extends MultivariateVectorFunction> public interface BaseMultivariateVectorOptimizer<FUNC extends MultivariateVectorFunction>
extends BaseOptimizer<VectorialPointValuePair> { extends BaseOptimizer<VectorialPointValuePair> {
/** /**
* Optimize an objective function. * Optimize an objective function.

View File

@ -24,7 +24,7 @@ package org.apache.commons.math.optimization;
* <ul> * <ul>
* <li>{@link org.apache.commons.math.optimization.MultivariateRealOptimizer}</li> * <li>{@link org.apache.commons.math.optimization.MultivariateRealOptimizer}</li>
* <li>{@link org.apache.commons.math.optimization.DifferentiableMultivariateRealOptimizer}</li> * <li>{@link org.apache.commons.math.optimization.DifferentiableMultivariateRealOptimizer}</li>
* <li>{@link org.apache.commons.math.optimization.DifferentiableMultivariateVectorialOptimizer}</li> * <li>{@link org.apache.commons.math.optimization.DifferentiableMultivariateVectorOptimizer}</li>
* <li>{@link org.apache.commons.math.optimization.univariate.UnivariateRealOptimizer}</li> * <li>{@link org.apache.commons.math.optimization.univariate.UnivariateRealOptimizer}</li>
* </ul> * </ul>
* *

View File

@ -27,7 +27,7 @@ import org.apache.commons.math.analysis.DifferentiableMultivariateFunction;
* maximize or minimize} an objective function. * maximize or minimize} an objective function.
* *
* @see MultivariateRealOptimizer * @see MultivariateRealOptimizer
* @see DifferentiableMultivariateVectorialOptimizer * @see DifferentiableMultivariateVectorOptimizer
* *
* @version $Id$ * @version $Id$
* @since 2.0 * @since 2.0

View File

@ -21,7 +21,7 @@ import org.apache.commons.math.analysis.DifferentiableMultivariateVectorFunction
import org.apache.commons.math.random.RandomVectorGenerator; import org.apache.commons.math.random.RandomVectorGenerator;
/** /**
* Special implementation of the {@link DifferentiableMultivariateVectorialOptimizer} * Special implementation of the {@link DifferentiableMultivariateVectorOptimizer}
* interface addind multi-start features to an existing optimizer. * interface addind multi-start features to an existing optimizer.
* *
* This class wraps a classical optimizer to use it several times in * This class wraps a classical optimizer to use it several times in
@ -31,9 +31,9 @@ import org.apache.commons.math.random.RandomVectorGenerator;
* @version $Id$ * @version $Id$
* @since 2.0 * @since 2.0
*/ */
public class MultiStartDifferentiableMultivariateVectorialOptimizer public class DifferentiableMultivariateVectorMultiStartOptimizer
extends BaseMultiStartMultivariateVectorialOptimizer<DifferentiableMultivariateVectorFunction> extends BaseMultivariateVectorMultiStartOptimizer<DifferentiableMultivariateVectorFunction>
implements DifferentiableMultivariateVectorialOptimizer { implements DifferentiableMultivariateVectorOptimizer {
/** /**
* Create a multi-start optimizer from a single-start optimizer. * Create a multi-start optimizer from a single-start optimizer.
* *
@ -43,8 +43,8 @@ public class MultiStartDifferentiableMultivariateVectorialOptimizer
* equal to 1. * equal to 1.
* @param generator Random vector generator to use for restarts. * @param generator Random vector generator to use for restarts.
*/ */
public MultiStartDifferentiableMultivariateVectorialOptimizer( public DifferentiableMultivariateVectorMultiStartOptimizer(
final DifferentiableMultivariateVectorialOptimizer optimizer, final DifferentiableMultivariateVectorOptimizer optimizer,
final int starts, final int starts,
final RandomVectorGenerator generator) { final RandomVectorGenerator generator) {
super(optimizer, starts, generator); super(optimizer, starts, generator);

View File

@ -27,5 +27,5 @@ import org.apache.commons.math.analysis.DifferentiableMultivariateVectorFunction
* @version $Id$ * @version $Id$
* @since 3.0 * @since 3.0
*/ */
public interface DifferentiableMultivariateVectorialOptimizer public interface DifferentiableMultivariateVectorOptimizer
extends BaseMultivariateVectorialOptimizer<DifferentiableMultivariateVectorFunction> {} extends BaseMultivariateVectorOptimizer<DifferentiableMultivariateVectorFunction> {}

View File

@ -26,7 +26,7 @@ import org.apache.commons.math.analysis.MultivariateFunction;
* maximize or minimize} an objective function.</p> * maximize or minimize} an objective function.</p>
* *
* @see DifferentiableMultivariateRealOptimizer * @see DifferentiableMultivariateRealOptimizer
* @see DifferentiableMultivariateVectorialOptimizer * @see DifferentiableMultivariateVectorOptimizer
* @version $Id$ * @version $Id$
* @since 2.0 * @since 2.0
*/ */

View File

@ -18,7 +18,7 @@
package org.apache.commons.math.optimization; package org.apache.commons.math.optimization;
/** This interface specifies how to check if a {@link /** This interface specifies how to check if a {@link
* DifferentiableMultivariateVectorialOptimizer optimization algorithm} has converged. * DifferentiableMultivariateVectorOptimizer optimization algorithm} has converged.
* *
* <p>Deciding if convergence has been reached is a problem-dependent issue. The * <p>Deciding if convergence has been reached is a problem-dependent issue. The
* user should provide a class implementing this interface to allow the optimization * user should provide a class implementing this interface to allow the optimization

View File

@ -23,7 +23,7 @@ import org.apache.commons.math.exception.TooManyEvaluationsException;
import org.apache.commons.math.exception.DimensionMismatchException; import org.apache.commons.math.exception.DimensionMismatchException;
import org.apache.commons.math.exception.NullArgumentException; import org.apache.commons.math.exception.NullArgumentException;
import org.apache.commons.math.analysis.MultivariateVectorFunction; import org.apache.commons.math.analysis.MultivariateVectorFunction;
import org.apache.commons.math.optimization.BaseMultivariateVectorialOptimizer; import org.apache.commons.math.optimization.BaseMultivariateVectorOptimizer;
import org.apache.commons.math.optimization.ConvergenceChecker; import org.apache.commons.math.optimization.ConvergenceChecker;
import org.apache.commons.math.optimization.VectorialPointValuePair; import org.apache.commons.math.optimization.VectorialPointValuePair;
import org.apache.commons.math.optimization.SimpleVectorialValueChecker; import org.apache.commons.math.optimization.SimpleVectorialValueChecker;
@ -39,7 +39,7 @@ import org.apache.commons.math.optimization.SimpleVectorialValueChecker;
* @since 3.0 * @since 3.0
*/ */
public abstract class BaseAbstractVectorialOptimizer<FUNC extends MultivariateVectorFunction> public abstract class BaseAbstractVectorialOptimizer<FUNC extends MultivariateVectorFunction>
implements BaseMultivariateVectorialOptimizer<FUNC> { implements BaseMultivariateVectorOptimizer<FUNC> {
/** Evaluations counter. */ /** Evaluations counter. */
protected final Incrementor evaluations = new Incrementor(); protected final Incrementor evaluations = new Incrementor();
/** Convergence checker. */ /** Convergence checker. */

View File

@ -23,7 +23,7 @@ import java.util.List;
import org.apache.commons.math.analysis.DifferentiableMultivariateVectorFunction; import org.apache.commons.math.analysis.DifferentiableMultivariateVectorFunction;
import org.apache.commons.math.analysis.ParametricUnivariateFunction; import org.apache.commons.math.analysis.ParametricUnivariateFunction;
import org.apache.commons.math.analysis.MultivariateMatrixFunction; import org.apache.commons.math.analysis.MultivariateMatrixFunction;
import org.apache.commons.math.optimization.DifferentiableMultivariateVectorialOptimizer; import org.apache.commons.math.optimization.DifferentiableMultivariateVectorOptimizer;
import org.apache.commons.math.optimization.VectorialPointValuePair; import org.apache.commons.math.optimization.VectorialPointValuePair;
/** Fitter for parametric univariate real functions y = f(x). /** Fitter for parametric univariate real functions y = f(x).
@ -41,14 +41,14 @@ import org.apache.commons.math.optimization.VectorialPointValuePair;
*/ */
public class CurveFitter { public class CurveFitter {
/** Optimizer to use for the fitting. */ /** Optimizer to use for the fitting. */
private final DifferentiableMultivariateVectorialOptimizer optimizer; private final DifferentiableMultivariateVectorOptimizer optimizer;
/** Observed points. */ /** Observed points. */
private final List<WeightedObservedPoint> observations; private final List<WeightedObservedPoint> observations;
/** Simple constructor. /** Simple constructor.
* @param optimizer optimizer to use for the fitting * @param optimizer optimizer to use for the fitting
*/ */
public CurveFitter(final DifferentiableMultivariateVectorialOptimizer optimizer) { public CurveFitter(final DifferentiableMultivariateVectorOptimizer optimizer) {
this.optimizer = optimizer; this.optimizer = optimizer;
observations = new ArrayList<WeightedObservedPoint>(); observations = new ArrayList<WeightedObservedPoint>();
} }

View File

@ -28,7 +28,7 @@ import org.apache.commons.math.exception.OutOfRangeException;
import org.apache.commons.math.exception.ZeroException; import org.apache.commons.math.exception.ZeroException;
import org.apache.commons.math.exception.NotStrictlyPositiveException; import org.apache.commons.math.exception.NotStrictlyPositiveException;
import org.apache.commons.math.exception.util.LocalizedFormats; import org.apache.commons.math.exception.util.LocalizedFormats;
import org.apache.commons.math.optimization.DifferentiableMultivariateVectorialOptimizer; import org.apache.commons.math.optimization.DifferentiableMultivariateVectorOptimizer;
import org.apache.commons.math.optimization.fitting.CurveFitter; import org.apache.commons.math.optimization.fitting.CurveFitter;
import org.apache.commons.math.optimization.fitting.WeightedObservedPoint; import org.apache.commons.math.optimization.fitting.WeightedObservedPoint;
@ -64,7 +64,7 @@ public class GaussianFitter extends CurveFitter {
* *
* @param optimizer Optimizer to use for the fitting. * @param optimizer Optimizer to use for the fitting.
*/ */
public GaussianFitter(DifferentiableMultivariateVectorialOptimizer optimizer) { public GaussianFitter(DifferentiableMultivariateVectorOptimizer optimizer) {
super(optimizer); super(optimizer);
} }

View File

@ -17,7 +17,7 @@
package org.apache.commons.math.optimization.fitting; package org.apache.commons.math.optimization.fitting;
import org.apache.commons.math.optimization.DifferentiableMultivariateVectorialOptimizer; import org.apache.commons.math.optimization.DifferentiableMultivariateVectorOptimizer;
import org.apache.commons.math.analysis.function.HarmonicOscillator; import org.apache.commons.math.analysis.function.HarmonicOscillator;
import org.apache.commons.math.exception.ZeroException; import org.apache.commons.math.exception.ZeroException;
import org.apache.commons.math.exception.NumberIsTooSmallException; import org.apache.commons.math.exception.NumberIsTooSmallException;
@ -41,7 +41,7 @@ public class HarmonicFitter extends CurveFitter {
* Simple constructor. * Simple constructor.
* @param optimizer Optimizer to use for the fitting. * @param optimizer Optimizer to use for the fitting.
*/ */
public HarmonicFitter(final DifferentiableMultivariateVectorialOptimizer optimizer) { public HarmonicFitter(final DifferentiableMultivariateVectorOptimizer optimizer) {
super(optimizer); super(optimizer);
} }

View File

@ -18,7 +18,7 @@
package org.apache.commons.math.optimization.fitting; package org.apache.commons.math.optimization.fitting;
import org.apache.commons.math.analysis.polynomials.PolynomialFunction; import org.apache.commons.math.analysis.polynomials.PolynomialFunction;
import org.apache.commons.math.optimization.DifferentiableMultivariateVectorialOptimizer; import org.apache.commons.math.optimization.DifferentiableMultivariateVectorOptimizer;
/** This class implements a curve fitting specialized for polynomials. /** This class implements a curve fitting specialized for polynomials.
* <p>Polynomial fitting is a very simple case of curve fitting. The * <p>Polynomial fitting is a very simple case of curve fitting. The
@ -40,7 +40,7 @@ public class PolynomialFitter extends CurveFitter {
* @param degree Maximal degree of the polynomial. * @param degree Maximal degree of the polynomial.
* @param optimizer Optimizer to use for the fitting. * @param optimizer Optimizer to use for the fitting.
*/ */
public PolynomialFitter(int degree, final DifferentiableMultivariateVectorialOptimizer optimizer) { public PolynomialFitter(int degree, final DifferentiableMultivariateVectorOptimizer optimizer) {
super(optimizer); super(optimizer);
this.degree = degree; this.degree = degree;
} }

View File

@ -26,7 +26,7 @@ import org.apache.commons.math.linear.LUDecomposition;
import org.apache.commons.math.linear.DecompositionSolver; import org.apache.commons.math.linear.DecompositionSolver;
import org.apache.commons.math.linear.MatrixUtils; import org.apache.commons.math.linear.MatrixUtils;
import org.apache.commons.math.optimization.ConvergenceChecker; import org.apache.commons.math.optimization.ConvergenceChecker;
import org.apache.commons.math.optimization.DifferentiableMultivariateVectorialOptimizer; import org.apache.commons.math.optimization.DifferentiableMultivariateVectorOptimizer;
import org.apache.commons.math.optimization.VectorialPointValuePair; import org.apache.commons.math.optimization.VectorialPointValuePair;
import org.apache.commons.math.optimization.direct.BaseAbstractVectorialOptimizer; import org.apache.commons.math.optimization.direct.BaseAbstractVectorialOptimizer;
import org.apache.commons.math.util.FastMath; import org.apache.commons.math.util.FastMath;
@ -50,7 +50,7 @@ import org.apache.commons.math.util.FastMath;
*/ */
public abstract class AbstractLeastSquaresOptimizer public abstract class AbstractLeastSquaresOptimizer
extends BaseAbstractVectorialOptimizer<DifferentiableMultivariateVectorFunction> extends BaseAbstractVectorialOptimizer<DifferentiableMultivariateVectorFunction>
implements DifferentiableMultivariateVectorialOptimizer { implements DifferentiableMultivariateVectorOptimizer {
/** Singularity threshold (cf. {@link #getCovariances(double)}). */ /** Singularity threshold (cf. {@link #getCovariances(double)}). */
private static final double DEFAULT_SINGULARITY_THRESHOLD = 1e-14; private static final double DEFAULT_SINGULARITY_THRESHOLD = 1e-14;
/** /**

View File

@ -42,8 +42,8 @@
* DifferentiableMultivariateRealOptimizer} for {@link * DifferentiableMultivariateRealOptimizer} for {@link
* org.apache.commons.math.analysis.DifferentiableMultivariateFunction * org.apache.commons.math.analysis.DifferentiableMultivariateFunction
* differentiable multivariate real functions}</li> * differentiable multivariate real functions}</li>
* <li>{@link org.apache.commons.math.optimization.DifferentiableMultivariateVectorialOptimizer * <li>{@link org.apache.commons.math.optimization.DifferentiableMultivariateVectorOptimizer
* DifferentiableMultivariateVectorialOptimizer} for {@link * DifferentiableMultivariateVectorOptimizer} for {@link
* org.apache.commons.math.analysis.DifferentiableMultivariateVectorFunction * org.apache.commons.math.analysis.DifferentiableMultivariateVectorFunction
* differentiable multivariate vectorial functions}</li> * differentiable multivariate vectorial functions}</li>
* </ul> * </ul>

View File

@ -93,21 +93,21 @@ import org.junit.Test;
* @author Jorge J. More (original fortran minpack tests) * @author Jorge J. More (original fortran minpack tests)
* @author Luc Maisonobe (non-minpack tests and minpack tests Java translation) * @author Luc Maisonobe (non-minpack tests and minpack tests Java translation)
*/ */
public class MultiStartDifferentiableMultivariateVectorialOptimizerTest { public class DifferentiableMultivariateVectorMultiStartOptimizerTest {
@Test @Test
public void testTrivial() { public void testTrivial() {
LinearProblem problem = LinearProblem problem =
new LinearProblem(new double[][] { { 2 } }, new double[] { 3 }); new LinearProblem(new double[][] { { 2 } }, new double[] { 3 });
DifferentiableMultivariateVectorialOptimizer underlyingOptimizer = DifferentiableMultivariateVectorOptimizer underlyingOptimizer =
new GaussNewtonOptimizer(true, new GaussNewtonOptimizer(true,
new SimpleVectorialValueChecker(1.0e-6, 1.0e-6)); new SimpleVectorialValueChecker(1.0e-6, 1.0e-6));
JDKRandomGenerator g = new JDKRandomGenerator(); JDKRandomGenerator g = new JDKRandomGenerator();
g.setSeed(16069223052l); g.setSeed(16069223052l);
RandomVectorGenerator generator = RandomVectorGenerator generator =
new UncorrelatedRandomVectorGenerator(1, new GaussianRandomGenerator(g)); new UncorrelatedRandomVectorGenerator(1, new GaussianRandomGenerator(g));
MultiStartDifferentiableMultivariateVectorialOptimizer optimizer = DifferentiableMultivariateVectorMultiStartOptimizer optimizer =
new MultiStartDifferentiableMultivariateVectorialOptimizer(underlyingOptimizer, new DifferentiableMultivariateVectorMultiStartOptimizer(underlyingOptimizer,
10, generator); 10, generator);
// no optima before first optimization attempt // no optima before first optimization attempt
@ -134,15 +134,15 @@ public class MultiStartDifferentiableMultivariateVectorialOptimizerTest {
@Test(expected=TestException.class) @Test(expected=TestException.class)
public void testNoOptimum() { public void testNoOptimum() {
DifferentiableMultivariateVectorialOptimizer underlyingOptimizer = DifferentiableMultivariateVectorOptimizer underlyingOptimizer =
new GaussNewtonOptimizer(true, new GaussNewtonOptimizer(true,
new SimpleVectorialValueChecker(1.0e-6, 1.0e-6)); new SimpleVectorialValueChecker(1.0e-6, 1.0e-6));
JDKRandomGenerator g = new JDKRandomGenerator(); JDKRandomGenerator g = new JDKRandomGenerator();
g.setSeed(12373523445l); g.setSeed(12373523445l);
RandomVectorGenerator generator = RandomVectorGenerator generator =
new UncorrelatedRandomVectorGenerator(1, new GaussianRandomGenerator(g)); new UncorrelatedRandomVectorGenerator(1, new GaussianRandomGenerator(g));
MultiStartDifferentiableMultivariateVectorialOptimizer optimizer = DifferentiableMultivariateVectorMultiStartOptimizer optimizer =
new MultiStartDifferentiableMultivariateVectorialOptimizer(underlyingOptimizer, new DifferentiableMultivariateVectorMultiStartOptimizer(underlyingOptimizer,
10, generator); 10, generator);
optimizer.optimize(100, new DifferentiableMultivariateVectorFunction() { optimizer.optimize(100, new DifferentiableMultivariateVectorFunction() {
public MultivariateMatrixFunction jacobian() { public MultivariateMatrixFunction jacobian() {

View File

@ -21,7 +21,7 @@ import java.util.Random;
import org.apache.commons.math.analysis.polynomials.PolynomialFunction; import org.apache.commons.math.analysis.polynomials.PolynomialFunction;
import org.apache.commons.math.exception.ConvergenceException; import org.apache.commons.math.exception.ConvergenceException;
import org.apache.commons.math.optimization.DifferentiableMultivariateVectorialOptimizer; import org.apache.commons.math.optimization.DifferentiableMultivariateVectorOptimizer;
import org.apache.commons.math.optimization.general.GaussNewtonOptimizer; import org.apache.commons.math.optimization.general.GaussNewtonOptimizer;
import org.apache.commons.math.optimization.general.LevenbergMarquardtOptimizer; import org.apache.commons.math.optimization.general.LevenbergMarquardtOptimizer;
import org.apache.commons.math.util.FastMath; import org.apache.commons.math.util.FastMath;
@ -89,12 +89,12 @@ public class PolynomialFitterTest {
@Test @Test
public void testRedundantUnsolvable() { public void testRedundantUnsolvable() {
// Gauss-Newton should not be able to solve redundant information // Gauss-Newton should not be able to solve redundant information
DifferentiableMultivariateVectorialOptimizer optimizer = DifferentiableMultivariateVectorOptimizer optimizer =
new GaussNewtonOptimizer(true); new GaussNewtonOptimizer(true);
checkUnsolvableProblem(optimizer, false); checkUnsolvableProblem(optimizer, false);
} }
private void checkUnsolvableProblem(DifferentiableMultivariateVectorialOptimizer optimizer, private void checkUnsolvableProblem(DifferentiableMultivariateVectorOptimizer optimizer,
boolean solvable) { boolean solvable) {
Random randomizer = new Random(1248788532l); Random randomizer = new Random(1248788532l);
for (int degree = 0; degree < 10; ++degree) { for (int degree = 0; degree < 10; ++degree) {