diff options
author | Alberto Ruiz <aruiz@um.es> | 2009-06-12 11:40:55 +0000 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2009-06-12 11:40:55 +0000 |
commit | 45e0e90ffdedd3c1fbe3da750018c65a1535cf75 (patch) | |
tree | 70bc753c18eaf91057ec4ee862b725c660259bbc | |
parent | cbd52c3668959cc62b28588d8fee2a4fe82cc3b0 (diff) |
minimize and root maxiter fixed
-rw-r--r-- | lib/Numeric/GSL/gsl-aux.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/Numeric/GSL/gsl-aux.c b/lib/Numeric/GSL/gsl-aux.c index d254705..0904a67 100644 --- a/lib/Numeric/GSL/gsl-aux.c +++ b/lib/Numeric/GSL/gsl-aux.c | |||
@@ -403,7 +403,7 @@ int minimize(int method, double f(int, double*), double tolsize, int maxit, | |||
403 | status = gsl_multimin_fminimizer_iterate (s); | 403 | status = gsl_multimin_fminimizer_iterate (s); |
404 | size = gsl_multimin_fminimizer_size (s); | 404 | size = gsl_multimin_fminimizer_size (s); |
405 | 405 | ||
406 | solp[iter*solc+0] = iter; | 406 | solp[iter*solc+0] = iter+1; |
407 | solp[iter*solc+1] = s->fval; | 407 | solp[iter*solc+1] = s->fval; |
408 | solp[iter*solc+2] = size; | 408 | solp[iter*solc+2] = size; |
409 | 409 | ||
@@ -414,7 +414,7 @@ int minimize(int method, double f(int, double*), double tolsize, int maxit, | |||
414 | iter++; | 414 | iter++; |
415 | if (status) break; | 415 | if (status) break; |
416 | status = gsl_multimin_test_size (size, tolsize); | 416 | status = gsl_multimin_test_size (size, tolsize); |
417 | } while (status == GSL_CONTINUE && iter < maxit); | 417 | } while (status == GSL_CONTINUE && iter <= maxit); |
418 | int i,j; | 418 | int i,j; |
419 | for (i=iter; i<solr; i++) { | 419 | for (i=iter; i<solr; i++) { |
420 | solp[i*solc+0] = iter; | 420 | solp[i*solc+0] = iter; |
@@ -501,7 +501,7 @@ int minimizeD(int method, double f(int, double*), int df(int, double*, int, doub | |||
501 | gsl_multimin_fdfminimizer_set (s, &my_func, V(xi), initstep, minimpar); | 501 | gsl_multimin_fdfminimizer_set (s, &my_func, V(xi), initstep, minimpar); |
502 | do { | 502 | do { |
503 | status = gsl_multimin_fdfminimizer_iterate (s); | 503 | status = gsl_multimin_fdfminimizer_iterate (s); |
504 | solp[iter*solc+0] = iter; | 504 | solp[iter*solc+0] = iter+1; |
505 | solp[iter*solc+1] = s->f; | 505 | solp[iter*solc+1] = s->f; |
506 | int k; | 506 | int k; |
507 | for(k=0;k<xin;k++) { | 507 | for(k=0;k<xin;k++) { |
@@ -510,7 +510,7 @@ int minimizeD(int method, double f(int, double*), int df(int, double*, int, doub | |||
510 | iter++; | 510 | iter++; |
511 | if (status) break; | 511 | if (status) break; |
512 | status = gsl_multimin_test_gradient (s->gradient, tolgrad); | 512 | status = gsl_multimin_test_gradient (s->gradient, tolgrad); |
513 | } while (status == GSL_CONTINUE && iter < maxit); | 513 | } while (status == GSL_CONTINUE && iter <= maxit); |
514 | int i,j; | 514 | int i,j; |
515 | for (i=iter; i<solr; i++) { | 515 | for (i=iter; i<solr; i++) { |
516 | solp[i*solc+0] = iter; | 516 | solp[i*solc+0] = iter; |
@@ -572,7 +572,7 @@ int root(int method, void f(int, double*, int, double*), | |||
572 | do { | 572 | do { |
573 | status = gsl_multiroot_fsolver_iterate (s); | 573 | status = gsl_multiroot_fsolver_iterate (s); |
574 | 574 | ||
575 | solp[iter*solc+0] = iter; | 575 | solp[iter*solc+0] = iter+1; |
576 | 576 | ||
577 | int k; | 577 | int k; |
578 | for(k=0;k<xin;k++) { | 578 | for(k=0;k<xin;k++) { |
@@ -589,7 +589,7 @@ int root(int method, void f(int, double*, int, double*), | |||
589 | status = | 589 | status = |
590 | gsl_multiroot_test_residual (s->f, epsabs); | 590 | gsl_multiroot_test_residual (s->f, epsabs); |
591 | } | 591 | } |
592 | while (status == GSL_CONTINUE && iter < maxit); | 592 | while (status == GSL_CONTINUE && iter <= maxit); |
593 | 593 | ||
594 | int i,j; | 594 | int i,j; |
595 | for (i=iter; i<solr; i++) { | 595 | for (i=iter; i<solr; i++) { |
@@ -687,7 +687,7 @@ int rootj(int method, int f(int, double*, int, double*), | |||
687 | do { | 687 | do { |
688 | status = gsl_multiroot_fdfsolver_iterate (s); | 688 | status = gsl_multiroot_fdfsolver_iterate (s); |
689 | 689 | ||
690 | solp[iter*solc+0] = iter; | 690 | solp[iter*solc+0] = iter+1; |
691 | 691 | ||
692 | int k; | 692 | int k; |
693 | for(k=0;k<xin;k++) { | 693 | for(k=0;k<xin;k++) { |
@@ -704,7 +704,7 @@ int rootj(int method, int f(int, double*, int, double*), | |||
704 | status = | 704 | status = |
705 | gsl_multiroot_test_residual (s->f, epsabs); | 705 | gsl_multiroot_test_residual (s->f, epsabs); |
706 | } | 706 | } |
707 | while (status == GSL_CONTINUE && iter < maxit); | 707 | while (status == GSL_CONTINUE && iter <= maxit); |
708 | 708 | ||
709 | int i,j; | 709 | int i,j; |
710 | for (i=iter; i<solr; i++) { | 710 | for (i=iter; i<solr; i++) { |