RsBundle  Diff

Differences From Artifact [7c6b12f5f4]:

  • File src/parallel/solver.rs — part of check-in [ff06564d0f] at 2019-07-20 13:56:00 on branch terminator — Implement new generic terminator interface (user: fifr size: 25941) [more...]

To Artifact [4dbc533216]:

  • File src/parallel/solver.rs — part of check-in [f5557bc6af] at 2019-07-20 14:17:40 on branch async — Remove unused parameters from `SolverParam` (user: fifr size: 25762)

104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
    num_subproblems: usize,
    /// The number of variables.
    num_vars: usize,
    /// The lower bounds on the variables.
    lower_bounds: Option<DVector>,
    /// The lower bounds on the variables.
    upper_bounds: Option<DVector>,
    /// The maximal number of inner updates.
    max_updates: usize,
}

/// A task for the master problem.
enum MasterTask<Pr> {
    /// Add a new minorant for a subfunction to the master problem.
    AddMinorant(usize, Minorant, Pr),








<
<







104
105
106
107
108
109
110


111
112
113
114
115
116
117
    num_subproblems: usize,
    /// The number of variables.
    num_vars: usize,
    /// The lower bounds on the variables.
    lower_bounds: Option<DVector>,
    /// The lower bounds on the variables.
    upper_bounds: Option<DVector>,


}

/// A task for the master problem.
enum MasterTask<Pr> {
    /// Add a new minorant for a subfunction to the master problem.
    AddMinorant(usize, Minorant, Pr),

353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
        self.master_rx = Some(rev_rx);

        let master_config = MasterConfig {
            num_subproblems: m,
            num_vars: n,
            lower_bounds: self.problem.lower_bounds().map(DVector),
            upper_bounds: self.problem.upper_bounds().map(DVector),
            max_updates: self.params.max_updates,
        };

        if master_config
            .lower_bounds
            .as_ref()
            .map(|lb| lb.len() != n)
            .unwrap_or(false)







<







351
352
353
354
355
356
357

358
359
360
361
362
363
364
        self.master_rx = Some(rev_rx);

        let master_config = MasterConfig {
            num_subproblems: m,
            num_vars: n,
            lower_bounds: self.problem.lower_bounds().map(DVector),
            upper_bounds: self.problem.upper_bounds().map(DVector),

        };

        if master_config
            .lower_bounds
            .as_ref()
            .map(|lb| lb.len() != n)
            .unwrap_or(false)
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
        // Initialize the master problem.
        master.set_num_subproblems(master_config.num_subproblems)?;
        master.set_vars(
            master_config.num_vars,
            master_config.lower_bounds,
            master_config.upper_bounds,
        )?;
        master.set_max_updates(master_config.max_updates)?;

        // The main iteration: wait for new tasks.
        for m in rx {
            match m {
                MasterTask::AddMinorant(i, m, primal) => {
                    debug!("master: add minorant to subproblem {}", i);
                    let index = master.add_minorant(i, m)?;







<







459
460
461
462
463
464
465

466
467
468
469
470
471
472
        // Initialize the master problem.
        master.set_num_subproblems(master_config.num_subproblems)?;
        master.set_vars(
            master_config.num_vars,
            master_config.lower_bounds,
            master_config.upper_bounds,
        )?;


        // The main iteration: wait for new tasks.
        for m in rx {
            match m {
                MasterTask::AddMinorant(i, m, primal) => {
                    debug!("master: add minorant to subproblem {}", i);
                    let index = master.add_minorant(i, m)?;