forum.alglib.net

ALGLIB forum
It is currently Sun Apr 28, 2024 9:19 am

All times are UTC


Forum rules


1. This forum can be used for discussion of both ALGLIB-related and general numerical analysis questions
2. This forum is English-only - postings in other languages will be removed.



Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: x[] values are set to NaN while attempting ASA optimization
PostPosted: Mon Nov 29, 2010 9:09 am 
Offline

Joined: Sun Nov 21, 2010 12:36 am
Posts: 1
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);



Top
 Profile  
 
 Post subject: Re: x[] values are set to NaN while attempting ASA optimizat
PostPosted: Mon Nov 29, 2010 11:07 am 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 906
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 :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 320 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group