Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | solver: Add `last_primal` method to `UpdateState`. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
40a866dae406c38379cd86518f1e4ab3 |
| User & Date: | fifr 2016-10-10 20:33:25.749 |
Context
|
2016-10-11
| ||
| 08:45 | solver: Check bounds for validity. check-in: d67ab3a0b0 user: fifr tags: trunk | |
|
2016-10-10
| ||
| 20:33 | solver: Add `last_primal` method to `UpdateState`. check-in: 40a866dae4 user: fifr tags: trunk | |
| 20:33 | solver: Add `cur_y` and `nxt_y` fields to `UpdateState`. check-in: 2b281a925b user: fifr tags: trunk | |
Changes
Changes to src/solver.rs.
| ︙ | ︙ | |||
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>,
|
| ︙ | ︙ |