On 11/23/2013 08:48 PM, rambor wrote:
> Hi Thomas,
> 
> Thank you for your help, it worked but uncovered a new problem.  I am doing
> the ill conditioned example in the test subdirectory of the src.  I can make
> a new instance of the NonLinearConjugateGradientOptimizer Class as:
> 
> NonLinearConjugateGradientOptimizer optimizer = new
> NonLinearConjugateGradientOptimizer(NonLinearConjugateGradientOptimizer.Formula.POLAK_RIBIERE,
> new SimpleValueChecker(1e-13, 1e-13), new BrentSolver(1e-15, 1e-15)); 
> 
> However, on the next line, when I try to use the optimize method I get
> another error:
> 
> PointValuePair optimum1 =
>                     optimizer.optimize(200, problem, GoalType.MINIMIZE, new
> double[] { 0, 1, 2, 3 });
> 
> java: no suitable method found for
> optimize(int,Regularizers.LinearProblem,org.apache.commons.math3.optim.nonlinear.scalar.GoalType,double[])
>     method
> org.apache.commons.math3.optim.nonlinear.scalar.gradient.NonLinearConjugateGradientOptimizer.optimize(org.apache.commons.math3.optim.OptimizationData...)
> is not applicable
>       (argument type int does not conform to vararg element type
> org.apache.commons.math3.optim.OptimizationData)
> 
> Should 200 be a MaxEval object?

yes, exactly.

All input to the optimize method must be wrapped in a data structure
derived from OptimizationData. It is maybe a bit confusing at first, but
once you know all the possible input types it is quite straight-forward
to use.

Normally the optimize method for each optimizer should also indicate
which input data is mandatory / possible. If you encounter a case where
this statement is wrong, please tell us.

Thomas

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to