Skip to content

Commit

Permalink
Merge pull request #3 from jmccrae/master
Browse files Browse the repository at this point in the history
Fix bug where the CG minimizer ignores the max_iter parameter
  • Loading branch information
noshu authored Jun 12, 2021
2 parents c8b414d + 4e9d5d7 commit 23a91bf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cg_minimizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl<'a> CG<'a> {
let grad = self.g;
let mut fval = func(self.x);
let mut gval = grad(self.x);
let icall = 0;
let mut icall = 0;
// start of the loop
loop {
// callign the fortran routine
Expand All @@ -64,6 +64,7 @@ impl<'a> CG<'a> {
self.irest,
self.method,
self.finish);
icall += 1;
if icall > self.max_iter {
break;
}
Expand Down

0 comments on commit 23a91bf

Please sign in to comment.