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>,
|