RsBundle  Diff

Differences From Artifact [12134cfbf2]:

  • File src/solver.rs — part of check-in [8d2547a9f9] at 2016-10-11 08:50:18 on branch trunk — Add variable+value update. (user: fifr size: 32036)

To Artifact [7c9788ca5e]:

  • File src/solver.rs — part of check-in [5221a3331a] at 2016-10-13 17:47:02 on branch trunk — Change parameters of `FirstOrderProblem::aggregate_primals`. Now the primals and coefficients are passed as (coeff, primal) pairs. This ensures that the number of coefficients always equals the number of primals by design. (user: fifr size: 32025)

764
765
766
767
768
769
770
771
772

773
774
775


776
777
778
779
780
781
782
764
765
766
767
768
769
770


771
772
773

774
775
776
777
778
779
780
781
782







-
-
+


-
+
+







                let aggr = self.minorants[i].split_off(self.params.max_bundle_size-2);
                let aggr_sum = aggr.iter().map(|m| m.multiplier).sum();
                let (aggr_mins, aggr_primals) : (Vec<_>, Vec<_>) = aggr.into_iter().map(|m| {
                    (m.index, m.primal.unwrap())
                }).unzip();
                let (aggr_min, aggr_coeffs) = try!(self.master.aggregate(i, &aggr_mins));
                // append aggregated minorant
                debug_assert_eq!(aggr_coeffs.len(), aggr_primals.len());
                self.minorants[i].push(MinorantInfo{
                self.minorants[i].push(MinorantInfo {
                    index: aggr_min,
                    multiplier: aggr_sum,
                    primal: Some(self.problem.aggregate_primals(&aggr_coeffs, aggr_primals)),
                    primal: Some(self.problem.aggregate_primals(
                       aggr_coeffs.into_iter().zip(aggr_primals.into_iter()).collect())),
                });
            }
        }
        Ok(())
    }

    /// Perform a descent step.