This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
design of functions in miltimin
- From: "Andrey V. Panov" <panov at canopus dot iacp dot dvo dot ru>
- To: gsl-discuss at sources dot redhat dot com
- Date: Tue, 1 Jul 2003 15:42:31 +1100
- Subject: design of functions in miltimin
- Organization: Institute for Automation and Control Processes
- Reply-to: panov at canopus dot iacp dot dvo dot ru
I think that the body of take_step() function in
multimin/directional_minimize.c :
{
gsl_vector_set_zero (dx);
gsl_blas_daxpy (-step * lambda, p, dx);
gsl_vector_memcpy (x1, x);
gsl_blas_daxpy (1.0, dx, x1);
}
can be replaced by more efficient code:
{
int i;
double dx_temp;
for(i = 0; i < dx->size; i++)
{
dx_temp = -step * lambda * gsl_vector_get(p, i);
gsl_vector_set(dx, i, dx_temp);
gsl_vector_set(x1, i, gsl_vector_get(x, i) + dx_temp);
}
}
There are also similar parts of code inside miltimin routines which may be
replaced.
--
Andrey V. Panov
http://canopus.iacp.dvo.ru/~panov/