RsBundle  Check-in [ff30e74d44]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:firstorderproblem: pass the subproblem index to `extend_subgradient`
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | async
Files: files | file ages | folders
SHA1: ff30e74d44b71dd5950a1d7b4413c552b9e2ed7a
User & Date: fifr 2019-07-25 10:31:27.455
Context
2019-07-25
13:53
Merge trunk check-in: f0a36f7482 user: fifr tags: async
10:31
Merge async check-in: 06adddf8f6 user: fifr tags: mmcf-separation
10:31
firstorderproblem: pass the subproblem index to `extend_subgradient` check-in: ff30e74d44 user: fifr tags: async
2019-07-24
11:00
Merge parallel-primal check-in: 652e59c865 user: fifr tags: async
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/firstorderproblem.rs.
159
160
161
162
163
164
165
166
167
168
169
170
171
172





173
174
175
    /// The default implementation returns no updates.
    fn update(&mut self, _state: &UpdateState<Self::Primal>) -> Result<Vec<Update>, Self::Err> {
        Ok(vec![])
    }

    /// Return new components for a subgradient.
    ///
    /// The components are typically generated by some primal
    /// information. The corresponding primal is passed as a
    /// parameter.
    ///
    /// The default implementation fails because it should never be
    /// called.
    fn extend_subgradient(&mut self, _primal: &Self::Primal, _vars: &[usize]) -> Result<Vec<Real>, Self::Err> {





        unimplemented!()
    }
}







|
|




|
>
>
>
>
>



159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
    /// The default implementation returns no updates.
    fn update(&mut self, _state: &UpdateState<Self::Primal>) -> Result<Vec<Update>, Self::Err> {
        Ok(vec![])
    }

    /// Return new components for a subgradient.
    ///
    /// The components are typically generated by some primal information. The
    /// corresponding primal along with its subproblem index is passed as a
    /// parameter.
    ///
    /// The default implementation fails because it should never be
    /// called.
    fn extend_subgradient(
        &mut self,
        _i: usize,
        _primal: &Self::Primal,
        _vars: &[usize],
    ) -> Result<Vec<Real>, Self::Err> {
        unimplemented!()
    }
}
Changes to src/solver.rs.
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
        if !newvars.is_empty() {
            let problem = &mut self.problem;
            let minorants = &self.minorants;
            self.master.add_vars(
                &newvars.iter().map(|v| (v.0, v.1, v.2)).collect::<Vec<_>>(),
                &mut |fidx, minidx, vars| {
                    problem
                        .extend_subgradient(minorants[fidx][minidx].primal.as_ref().unwrap(), vars)
                        .map(DVector)
                        .map_err(|e| e.into())
                },
            )?;
            // modify moved variables
            for (index, val) in newvars.iter().filter_map(|v| v.0.map(|i| (i, v.3))) {
                self.cur_y[index] = val;







|







686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
        if !newvars.is_empty() {
            let problem = &mut self.problem;
            let minorants = &self.minorants;
            self.master.add_vars(
                &newvars.iter().map(|v| (v.0, v.1, v.2)).collect::<Vec<_>>(),
                &mut |fidx, minidx, vars| {
                    problem
                        .extend_subgradient(fidx, minorants[fidx][minidx].primal.as_ref().unwrap(), vars)
                        .map(DVector)
                        .map_err(|e| e.into())
                },
            )?;
            // modify moved variables
            for (index, val) in newvars.iter().filter_map(|v| v.0.map(|i| (i, v.3))) {
                self.cur_y[index] = val;