RsBundle  Diff

Differences From Artifact [2fb2644257]:

  • File src/solver.rs — part of check-in [9bbb1b8836] at 2017-04-18 13:04:14 on branch trunk — Solver::solve returns `Error::IterationLimit` if limit has been reached. (user: fifr size: 35527)

To Artifact [28dfff2517]:

  • File src/solver.rs — part of check-in [fb00b3c18e] at 2017-04-18 13:08:24 on branch trunk — solver: do not call `init` in `solver_iter`. (user: fifr size: 35704)

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
            }