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)?;
|