RsBundle  Diff

Differences From Artifact [e29d89e899]:

  • File src/solver.rs — part of check-in [a5c90ab126] at 2018-08-30 11:07:51 on branch modifyprimals — Implement `Update::ModifyPrimals` (user: fifr size: 37929)

To Artifact [c304a5796a]:

  • File src/solver.rs — part of check-in [e1f5bd7920] at 2018-12-12 15:41:58 on branch modifyprimals — Merge trunk (user: fifr size: 38005) [more...]

12
13
14
15
16
17
18
19
20


21
22
23




24
25
26
27
28
29
30
12
13
14
15
16
17
18


19
20
21


22
23
24
25
26
27
28
29
30
31
32







-
-
+
+

-
-
+
+
+
+







//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see  <http://www.gnu.org/licenses/>
//

//! The main bundle method solver.

use {DVector, Real};
use {Evaluation, FirstOrderProblem, HKWeighter, Update};
use crate::{DVector, Real};
use crate::{Evaluation, FirstOrderProblem, HKWeighter, Update};

use master::{BoxedMasterProblem, Error as MasterProblemError, MasterProblem, UnconstrainedMasterProblem};
use master::{CplexMaster, MinimalMaster};
use crate::master::{BoxedMasterProblem, Error as MasterProblemError, MasterProblem, UnconstrainedMasterProblem};
use crate::master::{CplexMaster, MinimalMaster};

use log::{debug, info, warn};

use std::error::Error;
use std::f64::{INFINITY, NEG_INFINITY};
use std::fmt;
use std::mem::swap;
use std::result::Result;
use std::time::Instant;
712
713
714
715
716
717
718

719

720
721
722
723
724
725
726
714
715
716
717
718
719
720
721

722
723
724
725
726
727
728
729







+
-
+







                    &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())
                    },
                )
                ).map_err(SolverError::Master)?;
                .map_err(SolverError::Master)?;
            // modify moved variables
            for (index, val) in newvars.iter().filter_map(|v| v.0.map(|i| (i, v.3))) {
                self.cur_y[index] = val;
                self.nxt_y[index] = val;
                self.nxt_d[index] = 0.0;
            }
            // add new variables