576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
|
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
|
+
+
+
+
-
|
}
/// Solve the problem but stop after `niter` iterations.
///
/// The function returns `Ok(true)` if the termination criterion
/// has been satisfied. Otherwise it returns `Ok(false)` or an
/// error code.
///
/// If this function is called again, the solution process is
/// continued from the previous point. Because of this one must
/// call `init()` before the first call to this function.
pub fn solve_iter(&mut self, niter: usize) -> Result<bool> {
try!(self.init());
for _ in 0..niter {
let mut term = try!(self.step());
let changed = try!(self.update_problem(term));
// do not stop if the problem has been changed
if changed && term == Step::Term {
term = Step::Null
}
|