12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
//
// 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 crate::{DVector, Real};
use crate::{Evaluation, FirstOrderProblem, HKWeighter, Update};
use crate::master::{BoxedMasterProblem, Error as MasterProblemError, MasterProblem, UnconstrainedMasterProblem};
use crate::master::{CplexMaster, MinimalMaster};
use log::{debug, info, warn};
|
|
|
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
//
// 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 crate::{Aggregatable, DVector, Real};
use crate::{Evaluation, FirstOrderProblem, HKWeighter, Update};
use crate::master::{BoxedMasterProblem, Error as MasterProblemError, MasterProblem, UnconstrainedMasterProblem};
use crate::master::{CplexMaster, MinimalMaster};
use log::{debug, info, warn};
|
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
|
let (aggr_mins, aggr_primals): (Vec<_>, Vec<_>) =
aggr.into_iter().map(|m| (m.index, m.primal.unwrap())).unzip();
let (aggr_min, aggr_coeffs) = self.master.aggregate(i, &aggr_mins).map_err(SolverError::Master)?;
// append aggregated minorant
self.minorants[i].push(MinorantInfo {
index: aggr_min,
multiplier: aggr_sum,
primal: Some(
self.problem
.aggregate_primals(aggr_coeffs.into_iter().zip(aggr_primals.into_iter()).collect()),
),
});
}
}
Ok(())
}
/// Perform a descent step.
|
|
<
<
<
|
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
|
let (aggr_mins, aggr_primals): (Vec<_>, Vec<_>) =
aggr.into_iter().map(|m| (m.index, m.primal.unwrap())).unzip();
let (aggr_min, aggr_coeffs) = self.master.aggregate(i, &aggr_mins).map_err(SolverError::Master)?;
// append aggregated minorant
self.minorants[i].push(MinorantInfo {
index: aggr_min,
multiplier: aggr_sum,
primal: Some(Aggregatable::combine(aggr_coeffs.into_iter().zip(&aggr_primals))),
});
}
}
Ok(())
}
/// Perform a descent step.
|