RsBundle  Diff

Differences From Artifact [138b031a5e]:

  • File src/solver.rs — part of check-in [2b281a925b] at 2016-10-10 20:33:03 on branch trunk — solver: Add `cur_y` and `nxt_y` fields to `UpdateState`. (user: fifr size: 30462)

To Artifact [455923779f]:

  • File src/solver.rs — part of check-in [40a866dae4] at 2016-10-10 20:33:25 on branch trunk — solver: Add `last_primal` method to `UpdateState`. (user: fifr size: 30717)

320
321
322
323
324
325
326







327
328
329
330
331
332
333

impl<'a, Pr:'a> UpdateState<'a, Pr> {
    pub fn aggregated_primals(&self, subproblem : usize) -> Vec<(Real, &Pr)> {
        self.minorants[subproblem].iter().map(|m| {
            (m.multiplier, m.primal.as_ref().unwrap())
        }).collect()
    }







}

/**
 * Implementation of a bundle method.
 */
pub struct Solver<P, Pr, E>
    where P : for <'a> FirstOrderProblem<'a,Primal=Pr,EvalResult=E>,







>
>
>
>
>
>
>







320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340

impl<'a, Pr:'a> UpdateState<'a, Pr> {
    pub fn aggregated_primals(&self, subproblem : usize) -> Vec<(Real, &Pr)> {
        self.minorants[subproblem].iter().map(|m| {
            (m.multiplier, m.primal.as_ref().unwrap())
        }).collect()
    }

    /// Return the last primal for a given subproblem.
    ///
    /// This is the last primal generated by the oracle.
    pub fn last_primal(&self, fidx: usize) -> Option<&Pr> {
        self.minorants[fidx].last().and_then(|m| m.primal.as_ref())
    }
}

/**
 * Implementation of a bundle method.
 */
pub struct Solver<P, Pr, E>
    where P : for <'a> FirstOrderProblem<'a,Primal=Pr,EvalResult=E>,