RsBundle  Check-in [039c268628]

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

Overview
Comment:solver: Enlarge vectors when adding new variables.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 039c26862850de8a04d877bdf2a4d30c0a1d7a0f
User & Date: fifr 2016-10-05 20:20:40.857
Context
2016-10-06
06:18
vector: Add `add_scaled_begin` method. check-in: a69e819a6c user: fifr tags: trunk
2016-10-05
20:20
solver: Enlarge vectors when adding new variables. check-in: 039c268628 user: fifr tags: trunk
20:14
solver: Remove duplicate method `update_problem`. check-in: 8d95c5134e user: fifr tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/solver.rs.
538
539
540
541
542
543
544




545
546
547
548
549
550
551

        if !newvars.is_empty() {
            let mut problem = &mut self.problem;
            let minorants = &self.minorants;
            self.master.add_vars(&newvars, &mut move |fidx, minidx, vars| {
                problem.extend_subgradient(minorants[fidx][minidx].primal.as_ref().unwrap(), vars).unwrap()
            });




            Ok(true)
        } else {
            Ok(false)
        }
    }

    /// Return the current aggregated primal information for a subproblem.







>
>
>
>







538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555

        if !newvars.is_empty() {
            let mut problem = &mut self.problem;
            let minorants = &self.minorants;
            self.master.add_vars(&newvars, &mut move |fidx, minidx, vars| {
                problem.extend_subgradient(minorants[fidx][minidx].primal.as_ref().unwrap(), vars).unwrap()
            });
            let newn = self.cur_y.len() + newvars.len();
            self.cur_y.resize(newn, 0.0);
            self.nxt_d.resize(newn, 0.0);
            self.nxt_y.resize(newn, 0.0);
            Ok(true)
        } else {
            Ok(false)
        }
    }

    /// Return the current aggregated primal information for a subproblem.