summaryrefslogtreecommitdiff
path: root/lib/Numeric/GSL/gsl-aux.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Numeric/GSL/gsl-aux.c')
-rw-r--r--lib/Numeric/GSL/gsl-aux.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Numeric/GSL/gsl-aux.c b/lib/Numeric/GSL/gsl-aux.c
index 77e793e..3802574 100644
--- a/lib/Numeric/GSL/gsl-aux.c
+++ b/lib/Numeric/GSL/gsl-aux.c
@@ -441,7 +441,7 @@ void fdf_aux_min(const gsl_vector * x, void * pars, double * f, gsl_vector * g)
441} 441}
442 442
443// conjugate gradient 443// conjugate gradient
444int minimizeWithDeriv(double f(int, double*), void df(int, double*, double*), 444int minimizeWithDeriv(int method, double f(int, double*), void df(int, double*, double*),
445 double initstep, double minimpar, double tolgrad, int maxit, 445 double initstep, double minimpar, double tolgrad, int maxit,
446 KRVEC(xi), RMAT(sol)) { 446 KRVEC(xi), RMAT(sol)) {
447 REQUIRES(solr == maxit && solc == 2+xin,BAD_SIZE); 447 REQUIRES(solr == maxit && solc == 2+xin,BAD_SIZE);
@@ -463,7 +463,11 @@ int minimizeWithDeriv(double f(int, double*), void df(int, double*, double*),
463 // Starting point 463 // Starting point
464 KDVVIEW(xi); 464 KDVVIEW(xi);
465 // conjugate gradient fr 465 // conjugate gradient fr
466 T = gsl_multimin_fdfminimizer_conjugate_fr; 466 switch(method) {
467 case 0 : {T = gsl_multimin_fdfminimizer_conjugate_fr; break; }
468 case 1 : {T = gsl_multimin_fdfminimizer_vector_bfgs2; break; }
469 default: ERROR(BAD_CODE);
470 }
467 s = gsl_multimin_fdfminimizer_alloc (T, my_func.n); 471 s = gsl_multimin_fdfminimizer_alloc (T, my_func.n);
468 gsl_multimin_fdfminimizer_set (s, &my_func, V(xi), initstep, minimpar); 472 gsl_multimin_fdfminimizer_set (s, &my_func, V(xi), initstep, minimpar);
469 do { 473 do {