diff options
author | Alberto Ruiz <aruiz@um.es> | 2009-06-11 18:36:02 +0000 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2009-06-11 18:36:02 +0000 |
commit | cbd52c3668959cc62b28588d8fee2a4fe82cc3b0 (patch) | |
tree | b4181ea9f31fc56712a0370150ae615b7ae77faf /lib/Numeric/GSL | |
parent | 17b4295ce3927a1cda9b1fdb282318c92bc374cd (diff) |
check multimin iterate status
Diffstat (limited to 'lib/Numeric/GSL')
-rw-r--r-- | lib/Numeric/GSL/gsl-aux.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Numeric/GSL/gsl-aux.c b/lib/Numeric/GSL/gsl-aux.c index b811ee4..d254705 100644 --- a/lib/Numeric/GSL/gsl-aux.c +++ b/lib/Numeric/GSL/gsl-aux.c | |||
@@ -411,8 +411,9 @@ int minimize(int method, double f(int, double*), double tolsize, int maxit, | |||
411 | for(k=0;k<xin;k++) { | 411 | for(k=0;k<xin;k++) { |
412 | solp[iter*solc+k+3] = gsl_vector_get(s->x,k); | 412 | solp[iter*solc+k+3] = gsl_vector_get(s->x,k); |
413 | } | 413 | } |
414 | status = gsl_multimin_test_size (size, tolsize); | ||
415 | iter++; | 414 | iter++; |
415 | if (status) break; | ||
416 | status = gsl_multimin_test_size (size, tolsize); | ||
416 | } while (status == GSL_CONTINUE && iter < maxit); | 417 | } while (status == GSL_CONTINUE && iter < maxit); |
417 | int i,j; | 418 | int i,j; |
418 | for (i=iter; i<solr; i++) { | 419 | for (i=iter; i<solr; i++) { |
@@ -506,8 +507,9 @@ int minimizeD(int method, double f(int, double*), int df(int, double*, int, doub | |||
506 | for(k=0;k<xin;k++) { | 507 | for(k=0;k<xin;k++) { |
507 | solp[iter*solc+k+2] = gsl_vector_get(s->x,k); | 508 | solp[iter*solc+k+2] = gsl_vector_get(s->x,k); |
508 | } | 509 | } |
509 | status = gsl_multimin_test_gradient (s->gradient, tolgrad); | ||
510 | iter++; | 510 | iter++; |
511 | if (status) break; | ||
512 | status = gsl_multimin_test_gradient (s->gradient, tolgrad); | ||
511 | } while (status == GSL_CONTINUE && iter < maxit); | 513 | } while (status == GSL_CONTINUE && iter < maxit); |
512 | int i,j; | 514 | int i,j; |
513 | for (i=iter; i<solr; i++) { | 515 | for (i=iter; i<solr; i++) { |