This is the mail archive of the gsl-discuss@sourceware.cygnus.com 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]

Re: multidimensional optimization


Brian Gough wrote:
> Regarding the code, it would be good to work on the client side and
> see if it can be simplified. Maybe some of the alloc/set code in the
> client loop can be moved outside the loop, or into the library.
> Simplification of that sort of loop is very beneficial for the user.

As Brian said, the use of multidimensional optimization algorithms is
currently quite complex, mainly because of the interaction with the 1d
minimization algo. The main trouble is that when you allocate a 1d min algo,
you have to provide an initial bracketing, which has to be correct. This is
the right way to do (catch errors as soon as possible), but this makes the
inner loop of the multi dim quite complex to write (see test.c in multimin
directory). 

I propose to include in the multidim algo a 1d min algorithm, simply by
specifing it's type to gsl_multimin_fdf_minimizer_alloc. I propose also to
support different bracketing algorithms, but only trough a function pointer. I
don't think external control of the bracketing algorithm is needed (except to
provide the number of iterations and perhaps a precision) and therefore I
don't think we have to provide state handling. So the bracketing algorithm
will be also given to gsl_multimin_fdf_minimizer_alloc.

With this approach, I plan to simplify the main loop in order to obtain
something like that:
gsl_multimin_fdf_minimizer *s=gsl_multimin_fdf_minimizer_alloc(parameters);
do {
	status = gsl_multimin_fdf_minimizer_next_direction(s);
	/* react on status */
	status = gsl_multimin_fdf_minimizer_bracket(s);
	/* react on status */
	do {
		status = gsl_multimin_fdf_minimizer_iterate_1d(s);
		/* react on status */
	} while (stopping criterion for the 1d algorithm);
	status = gsl_multimin_fdf_minimizer_step(s);
	/* react on status */
} while (stopping criterion for the multidim algo);

With this approach, you still have full control over the internal line search,
but with a simplified interface. Drawbacks:
- the fdf structure is going to be even more bloated that it is currently
- changing the line search algorithm will not be as easy as it is currently
- same thing for bracketing

Any comments or idea?

Fabrice Rossi

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