RsBundle  Diff

Differences From Artifact [c304a5796a]:

  • File src/solver.rs — part of check-in [e1f5bd7920] at 2018-12-12 15:41:58 on branch modifyprimals — Merge trunk (user: fifr size: 38005) [more...]

To Artifact [3b74e53843]:

  • File src/solver.rs — part of check-in [45d9ecf62b] at 2019-12-21 21:28:16 on branch modifyprimals — Add `dyn` to trait object types (user: fifr size: 38020)

84
85
86
87
88
89
90
91

92
93
94
95
96
97
98
84
85
86
87
88
89
90

91
92
93
94
95
96
97
98







-
+







            ),
            IterationLimit { limit } => write!(fmt, "The iteration limit of {} has been reached.", limit),
        }
    }
}

impl<E: Error> Error for SolverError<E> {
    fn cause(&self) -> Option<&Error> {
    fn cause(&self) -> Option<&dyn Error> {
        match self {
            SolverError::Evaluation(err) => Some(err),
            SolverError::Update(err) => Some(err),
            SolverError::Master(err) => Some(err),
            _ => None,
        }
    }
388
389
390
391
392
393
394
395

396
397
398

399
400
401
402
403
404
405
388
389
390
391
392
393
394

395
396
397

398
399
400
401
402
403
404
405







-
+


-
+







    /// The first order problem description.
    problem: P,

    /// The solver parameter.
    pub params: SolverParams,

    /// Termination predicate.
    pub terminator: Box<Terminator>,
    pub terminator: Box<dyn Terminator>,

    /// Weighter heuristic.
    pub weighter: Box<Weighter>,
    pub weighter: Box<dyn Weighter>,

    /// Lower and upper bounds of all variables.
    bounds: Vec<(Real, Real)>,

    /// Current center of stability.
    cur_y: DVector,

460
461
462
463
464
465
466
467

468
469
470
471
472
473
474
460
461
462
463
464
465
466

467
468
469
470
471
472
473
474







-
+







     * Time when the solution process started.
     *
     * This is actually the time of the last call to `Solver::init`.
     */
    start_time: Instant,

    /// The master problem.
    master: Box<MasterProblem<MinorantIndex = usize>>,
    master: Box<dyn MasterProblem<MinorantIndex = usize>>,

    /// The active minorant indices for each subproblem.
    minorants: Vec<Vec<MinorantInfo<P::Primal>>>,

    /// Accumulated information about the last iteration.
    iterinfos: Vec<IterationInfo>,
}
694
695
696
697
698
699
700
701

702
703
704
705
706
707
708
694
695
696
697
698
699
700

701
702
703
704
705
706
707
708







-
+







                            subproblem: subproblem,
                            nsubs: self.minorants.len(),
                        });
                    }
                    for m in &mut self.minorants[subproblem] {
                        if let Some(ref mut p) = m.primal {
                            if let Err(err) = modify(p) {
                                return Err(SolverError::Update(err));;
                                return Err(SolverError::Update(err));
                            }
                        }
                    }
                }
            }
        }