RsBundle  Diff

Differences From Artifact [e48ceabc0d]:

  • File src/mcf/problem.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: 10846)

To Artifact [4206da236f]:

  • File src/mcf/problem.rs — part of check-in [f1406e69ec] at 2019-07-15 19:53:19 on branch aggregatable — mcf.problem: use `iter` instead of `into_iter` (user: fifr size: 10841) [more...]

229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
    where
        Self: 'a,
        I: IntoIterator<Item = (Real, &'a Vec<DVector>)>,
    {
        let mut x: Vec<DVector>;
        let mut it = aggregates.into_iter();
        if let Some((alpha, y)) = it.next() {
            x = y.into_iter().map(|yi| yi.scaled(alpha)).collect();
        } else {
            return vec![];
        }

        for (alpha, y) in it {
            for i in 0..x.len() {
                x[i].add_scaled(alpha, &y[i]);







|







229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
    where
        Self: 'a,
        I: IntoIterator<Item = (Real, &'a Vec<DVector>)>,
    {
        let mut x: Vec<DVector>;
        let mut it = aggregates.into_iter();
        if let Some((alpha, y)) = it.next() {
            x = y.iter().map(|yi| yi.scaled(alpha)).collect();
        } else {
            return vec![];
        }

        for (alpha, y) in it {
            for i in 0..x.len() {
                x[i].add_scaled(alpha, &y[i]);