forum.alglib.net
http://forum.alglib.net/

x[] values are set to NaN while attempting ASA optimization
http://forum.alglib.net/viewtopic.php?f=2&t=130
Page 1 of 1

Author:  ForSpareParts [ Mon Nov 29, 2010 9:09 am ]
Post subject:  x[] values are set to NaN while attempting ASA optimization

Hey guys,

Trying to optimize a problem through alglib's minasa system, and I'm getting a weird problem. Well, two weird problems. They may be related:

1. The optimization process never terminates -- even when set to a very low number of iterations.

2. If I set breakpoints inside my ndimensional_grad function, I find that the argument array (double[] x) gets set to NaN after a couple runs.

Any ideas? The initial guess is all zeros, and my grad function never assigns a value to the argument array. Here's the code that calls minasa:

Code:
double[] x = new double[] { 0, 0, 0, 0, 0 };

double[] bndl = new double[5];
double[] bndu = new double[5];

//omitted: a for loop that populates bndl with zeros and bndu with maximums according to my problem -- all positive numbers

double epsg = 0.0000000001;
epsg = 0;
double epsf = 0;
double epsx = 0;
int maxits = 10;
alglib.minasastate state;
alglib.minasareport rep;

alglib.minasacreate(x, bndl, bndu, out state);
alglib.minasasetcond(state, epsg, epsf, epsx, maxits);
alglib.minasaoptimize(state, function_name, null, null);
alglib.minasaresults(state, out x, out rep);


Author:  Sergey.Bochkanov [ Mon Nov 29, 2010 11:07 am ]
Post subject:  Re: x[] values are set to NaN while attempting ASA optimizat

Can you post full code here so I will be able to debug it? Code which includes:
* initialization of bndl and bndu
* your ndimensional_grad function

It is too hard to figure out something without having a code to compile :)

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/