RsBundle  Diff

Differences From Artifact [96f26bc075]:

  • File src/solver.rs — part of check-in [ce9ab8ec19] at 2017-03-06 16:50:42 on branch trunk — Add `MoveVariable` update. The `Solver` struct accepts these updates and handles them. However, they are not passed to the master problem, yet. (user: fifr size: 34756)

To Artifact [3605d4b83e]:

  • File src/solver.rs — part of check-in [3d746e5739] at 2017-03-06 16:58:42 on branch trunk — master: allow moving of existing variables. This changes the master problem API, but the implementation of `boxed` does not yet implement this feature. (user: fifr size: 34724)

636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651

652
653
654
655
656
657
658
636
637
638
639
640
641
642

643
644
645
646
647
648
649

650
651
652
653
654
655
656
657







-







-
+







                        return Err(Error::InvalidVariable(index, self.bounds.len()));
                    }
                    let (lower, upper) = self.bounds[index];
                    if value < lower || value > upper {
                        return Err(Error::ViolatedBounds(lower, upper, value));
                    }
                    newvars.push((Some(index), lower - value, upper - value, value));
                    unimplemented!()
                }
            }
        }

        if !newvars.is_empty() {
            let mut problem = &mut self.problem;
            let minorants = &self.minorants;
            self.master.add_vars(&newvars.iter().map(|v| (v.1, v.2)).collect::<Vec<_>>(),
            self.master.add_vars(&newvars.iter().map(|v| (v.0, v.1, v.2)).collect::<Vec<_>>(),
                                 &mut move |fidx, minidx, vars| {
                                     problem.extend_subgradient(minorants[fidx][minidx].primal.as_ref().unwrap(), vars)
                                         .map(DVector)
                                         .unwrap()
                                 });
            // modify moved variables
            for (index, val) in newvars.iter().filter_map(|v| v.0.map(|i| (i, v.3))) {