This is the mail archive of the gsl-discuss@sourceware.org mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fwd: GSL mnultimin


Howdy,

Passing along this question about Math::GSL here, since this list is
more appropriate.

Duke


---------- Forwarded message ----------
From: Filipe G. Vieira <fgvieira@berkeley.edu>
Date: Mon, Jan 23, 2012 at 10:44 AM
Subject: GSL mnultimin
To: jonathan@leto.net, thierry.moisan@gmail.com



Hi,

I've just found your perl module to run GSL::multimin.
I'm trying to use that functions in C++ but I have a doubt that,
despite not related to the perl module, I thought you might be able to
help me with.
I want to limit the search space to [0,1] but the GSL function has no
limit option. I tried to implement myself and I came up with two
alternatives but I don't know if they are the best options.

One is to just return a high score whenever the parameter goes out of
the interval:
if(gsl_vector_get(0,i) < min || gsl_vector_get(x,i) > max) return 1e100;

The other is to set the parameter to 0:
if(gsl_vector_get(0,i) < min) x->data[0] = min;
if(gsl_vector_get(0,i) > max) x->data[0] = max;


Are these approaches correct? Which one is the best? Any better way to do it?
thanks,
FGV


-- 
Jonathan "Duke" Leto <jonathan@leto.net>
Leto Labs LLC
209.691.DUKE // http://labs.leto.net
NOTE: Personal email is only checked twice a day at 10am/2pm PST,
please call/text for time-sensitive matters.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]