RsBundle  Diff

Differences From Artifact [916c4342a2]:

  • File src/solver.rs — part of check-in [a98dc9db36] at 2019-07-15 10:58:51 on branch aggregatable — FirstOrderProblem: require `Primal` to be aggregatable. This allows to remove the `aggregate_primals` methods. (user: fifr size: 36985)

To Artifact [259796f0a0]:

  • File src/solver.rs — part of check-in [3c9ee37585] at 2019-07-15 11:18:49 on branch aggregatable — Solver: simplify `aggregated_primals` (user: fifr size: 37008)

1

2
3
4
5
6
7
8

1
2
3
4
5
6
7
8
-
+







// Copyright (c) 2016, 2017, 2018 Frank Fischer <frank-fischer@shadow-soft.de>
// Copyright (c) 2016, 2017, 2018, 2019 Frank Fischer <frank-fischer@shadow-soft.de>
//
// This program is free software: you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
719
720
721
722
723
724
725
726
727
728
729





730

731
732
733
734
735
736
737
719
720
721
722
723
724
725




726
727
728
729
730

731
732
733
734
735
736
737
738







-
-
-
-
+
+
+
+
+
-
+








    /// Return the current aggregated primal information for a subproblem.
    ///
    /// This function returns all currently used minorants $x_i$ along
    /// with their coefficients $\alpha_i$. The aggregated primal can
    /// be computed by combining the minorants $\bar{x} =
    /// \sum_{i=1}\^m \alpha_i x_i$.
    pub fn aggregated_primals(&self, subproblem: usize) -> Vec<(Real, &P::Primal)> {
        self.minorants[subproblem]
            .iter()
            .map(|m| (m.multiplier, m.primal.as_ref().unwrap()))
    pub fn aggregated_primals(&self, subproblem: usize) -> P::Primal {
        Aggregatable::combine(
            self.minorants[subproblem]
                .iter()
                .map(|m| (m.multiplier, m.primal.as_ref().unwrap())),
            .collect()
        )
    }

    fn show_info(&self, step: Step) {
        let time = self.start_time.elapsed();
        info!(
            "{} {:0>2}:{:0>2}:{:0>2}.{:0>2} {:4} {:4} {:4}{:1}  {:9.4} {:9.4} \
             {:12.6e}({:12.6e}) {:12.6e}",