public inbox for
 help / color / mirror / Atom feed
* Fwd: GSL mnultimin
       [not found] <>
@ 2012-01-23 19:49 ` Jonathan "Duke" Leto
  0 siblings, 0 replies; only message in thread
From: Jonathan "Duke" Leto @ 2012-01-23 19:49 UTC (permalink / raw)
  To: gsl-discuss; +Cc: Filipe G. Vieira, Thierry Moisan


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


---------- Forwarded message ----------
From: Filipe G. Vieira <>
Date: Mon, Jan 23, 2012 at 10:44 AM
Subject: GSL mnultimin


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?

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-01-23 19:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <>
2012-01-23 19:49 ` Fwd: GSL mnultimin Jonathan "Duke" Leto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).