3 #ifndef CONICBUNDLE_SUMMODEL_HXX 4 #define CONICBUNDLE_SUMMODEL_HXX 23 class SumModelParametersObject;
141 typedef std::map<const FunctionObject*,ModelData*>
ModelMap;
253 bool accept_only_higher_values=
false,
300 bool keep_penalty_fixed);
380 void clear_model(
bool discard_minorants_only=
false);
406 void set_out(std::ostream* o=0,
int pril=1);
414 for (ModelMap::const_iterator it=modelmap.begin();it!=modelmap.end();it++){
415 ms+=it->second->model()->get_preeval_time();
423 for (ModelMap::const_iterator it=modelmap.begin();it!=modelmap.end();it++){
424 ms+=it->second->model()->get_eval_time();
433 for (ModelMap::const_iterator it=modelmap.begin();it!=modelmap.end();it++){
434 ms+=it->second->model()->get_posteval_time();
int Integer
all integer numbers in calculations and indexing are of this type
Definition: matop.hxx:40
SumModelParametersObject * model_selection
parameters and routines for choosing the models for SumBundle
Definition: SumModel.hxx:174
SumBlockModel * remove_model(const FunctionObject *fo)
remove the submodel identified by fo from this model, this does NOT destruct the model. It returns the pointer to the model if there is one, otherwise 0
const BundleData * get_data() const
see SumBlockModel::get_data()
Definition: SumModel.hxx:349
virtual int init(const BundleData *bd)
initialize from other BundleData
Header declaring the class ConicBundle::SumBlockModel.
int eval_function(CH_Matrix_Classes::Integer &ub_fid, CH_Matrix_Classes::Real &ub, CH_Matrix_Classes::Integer y_id, const CH_Matrix_Classes::Matrix &y, CH_Matrix_Classes::Real nullstep_bound, CH_Matrix_Classes::Real relprec)
see BundleModel::eval_function
BundleData data
the relevant data for running BundleSolver consistently
Definition: SumModel.hxx:150
abstract interface that allows to use different -norms with a positive definite matrix in the proxi...
Definition: BundleProxObject.hxx:88
QPSumModelDataObject * block
collects the blocks of the submodels
Definition: SumModel.hxx:171
SumBlockModel * model() const
returns aft_model if this is not NULL, otherwise oracle_model
Definition: SumModel.hxx:112
abstract interface extending BundleModel so that any such model can be used alone or within SumModel ...
Definition: SumBlockModel.hxx:102
std::list< const ModelData * > local_augmodel
if the sumbundle is active, this collects all models that have a separate augmented model part and ne...
Definition: SumModel.hxx:156
double Real
all real numbers in calculations are of this type
Definition: matop.hxx:50
ModifiableOracleObject * get_oracle_object()
as AFTModel has no oracle of its own, this returns the dummy oracle
Definition: SumModel.hxx:294
CH_Matrix_Classes::Real model_deviation
for judging whether to use a local model or to suggest contribution to summodel, function_value(y)-ag...
Definition: SumModel.hxx:96
For each model added to the sum, there is an object ModelData that stores required information...
Definition: SumModel.hxx:80
ModelMap modelmap
this holds the ModelData indexed by the (unique) FunctionObject pointer
Definition: SumModel.hxx:153
abstract interface for automatically generating and retrieving the qp blocks with the model data that...
Definition: QPModelDataObject.hxx:298
the SumBundle/part is maybe maintained but currently not in use anywhere
Definition: SumBundle.hxx:197
int set_data(BundleData *bd)
see SumBlockModel::set_data()
Definition: SumModel.hxx:352
bool model_aggregate_modified(CH_Matrix_Classes::Integer old_model_aggregate_id)
see BundleModel::model_aggregate_modified
CH_Matrix_Classes::Real weighted_curvature
for judging whether to use a local model or to suggest contribution to summodel, this is changed/upda...
Definition: SumModel.hxx:105
ModifiableOracleObject dummy_oracle
the oracle object of this model
Definition: SumModel.hxx:146
Matrix class for integral values of type Integer
Definition: indexmat.hxx:195
abstract interface for SumModel for the models selection routine when using SumBundle and SumBundleHa...
Definition: SumModelParametersObject.hxx:40
int get_center_minorant(MinorantPointer &minorant, const AffineFunctionTransformation *aft=0)
see SumBlockModel::get_center_minorant()
const PrimalData * get_approximate_primal() const
this has no primals, so it returns 1, see SumBlockModel::get_approximate_primal
Definition: SumModel.hxx:362
int adjust_multiplier(bool &values_may_have_changed)
see SumBlockModel::adjust_multiplier()
int synchronize_ids(CH_Matrix_Classes::Integer &new_center_ub_fid, CH_Matrix_Classes::Integer new_center_id, CH_Matrix_Classes::Integer old_center_id, CH_Matrix_Classes::Integer &new_cand_ub_fid, CH_Matrix_Classes::Integer new_cand_id, CH_Matrix_Classes::Integer old_cand_id, CH_Matrix_Classes::Integer &new_aggregate_id)
see BundleModel::synchronize_ids
Header declaring the class ConicBundle::AFTModel.
the latest function evaluation and its subgradient give rise to a descent step, preserving the aggreg...
Definition: BundleModel.hxx:151
CH_Matrix_Classes::Real & set_deviation_contribution()
get and set the accumulated contribution of this function to the total deviation
Definition: SumModel.hxx:128
virtual int start_sumaugmodel(QPModelDataPointer &blockp, CH_Matrix_Classes::Integer cand_id, const CH_Matrix_Classes::Matrix &cand_y, const CH_Matrix_Classes::Indexmatrix *indices=0, SumBundleHandler *bh=0, SumBundle::Mode mode=SumBundle::inactive, AffineFunctionTransformation *aft=0)
see BundleModel::start_augmodel() for the first four parameters; for the others see sumbundle_contrib...
virtual CH_Tools::Microseconds get_eval_time() const
see SumBlockModel::get_eval_time()
Definition: SumModel.hxx:420
CH_Matrix_Classes::Integer cand_ub_fid
-1 if not initialized, otherwise the identifier returned by the calls giving the cand_ub_value ...
Definition: SumModel.hxx:91
CH_Matrix_Classes::Integer center_ub_fid
-1 if not initialized, otherwise the identifier returned by the call giving the center_ub_value ...
Definition: SumModel.hxx:89
int make_model_aggregate(bool &penalty_parameter_increased, bool keep_penalty_fixed)
see SumBlockModel::make_model_aggregate
CH_Matrix_Classes::Real & set_weighted_curvature()
get and set the accumulated curvature information of this function
Definition: SumModel.hxx:132
Mode
specifies for different parts of the sumbundle whether it is active and who is responsible for handli...
Definition: SumBundle.hxx:194
void clear_model(bool discard_minorants_only=false)
see SumBlockModel::clear_model
conic bundle method solver for sum of convex functions. See the ConicBundle_Manual for a quick introd...
Definition: CBSolver.hxx:22
gives a SumBlockModel interface to a sum of (possibly AffineFunctionTransformation transformed) SumBl...
Definition: SumModel.hxx:58
base class for uniform use of WARNINGS and ERRORS (at some point in time)
Definition: CBout.hxx:30
const PrimalData * get_center_primal() const
this has no primals, so it returns 1, see SumBlockModel::get_center_primal
Definition: SumModel.hxx:365
int provide_model_aggregate(CH_Matrix_Classes::Integer y_id, const CH_Matrix_Classes::Matrix &y)
see BundleModel::provide_model_aggregate
ModelUpdate
for informing update_model() at what stage it is called to update the bundle so that the amount of in...
Definition: BundleModel.hxx:149
int get_function_minorant(MinorantPointer &minorant, const AffineFunctionTransformation *aft=0)
see SumBlockModel::get_function_minorant()
void clear_aggregates()
see SumBlockModel::clear_aggregates
std::map< const FunctionObject *, ModelData * > ModelMap
a ModelMap maps FunctionObject pointers (these must be unique) to their ModelData ...
Definition: SumModel.hxx:141
virtual CH_Tools::Microseconds get_posteval_time() const
see SumBlockModel::get_posteval_time()
Definition: SumModel.hxx:430
Serves for specifying parameters regarding the construction of cutting models.
Definition: CBSolver.hxx:891
bool center_modified(CH_Matrix_Classes::Integer &function_modification_id, CH_Matrix_Classes::Integer center_id)
see BundleModel::center_modified
int sumbundle_mode(SumBundle::Mode &mode, SumBundleHandler *bh=0, AffineFunctionTransformation *aft=0)
see SumBlockModel::sumbundle_mode
CH_Tools::Microseconds preeval_time
total time spent in eval_function() before the oracle call
Definition: SumBlockModel.hxx:109
interface class that allows a VariableMetricModel to contribute information to a VariableMetric objec...
Definition: VariableMetric.hxx:309
int eval_model(CH_Matrix_Classes::Real &lb, CH_Matrix_Classes::Integer y_id, const CH_Matrix_Classes::Matrix &y, CH_Matrix_Classes::Real relprec)
see BundleModel::eval_model
int set_bundle_parameters(const BundleParameters &bp)
if bp is a SumBundleParametersObject, it is cloned, otherwise the paraemters are copied ...
CH_Matrix_Classes::Integer aggregate_id
-1 if not initialized, otherwise the identifier returned by the last call to get_model_aggregate ...
Definition: SumModel.hxx:93
void set_out(std::ostream *o=0, int pril=1)
set output and outputlevel of warnings and errors recursively, see CBout
void clear()
resets the SumModel to its initial state, in particular it removes but does not delete any Models add...
int add_variable_metric(VariableMetric &H, CH_Matrix_Classes::Integer y_id, const CH_Matrix_Classes::Matrix &y, bool descent_step, CH_Matrix_Classes::Real weightu, CH_Matrix_Classes::Real model_maxviol, const CH_Matrix_Classes::Indexmatrix *indices=0)
see BundleModel::add_dynamic_scaling
MinorantPointer cand_minorant
the minorant in the candidate (if collected explicitly)
Definition: SumModel.hxx:163
ModifiableOracle provides all oracles with a uniform interface for a modification routine and an on/o...
Definition: MatrixCBSolver.hxx:309
Matrix class for real values of type Real
Definition: matrix.hxx:74
CH_Matrix_Classes::Integer ncalls
number of (recursive) calls to eval_function or recompute_center
Definition: SumModel.hxx:160
std::map< const FunctionObject *, FunctionObjectModification > FunObjModMap
In order to pass on problem modifications, FunObjModMap allows to specify a FunctionObjectModificatio...
Definition: FunctionObjectModification.hxx:104
routines for updating and handling SumBundle components, possibly by cooperating over several recursi...
Definition: SumBundleHandler.hxx:42
CH_Tools::Microseconds posteval_time
total time spent in eval_function() after the oracle call
Definition: SumBlockModel.hxx:110
int apply_modification(bool &no_changes, const GroundsetModification &gsmdf, const FunObjModMap &funmdfmap, CH_Matrix_Classes::Integer new_center_id, const CH_Matrix_Classes::Matrix &new_center, CH_Matrix_Classes::Integer old_center_id, const CH_Matrix_Classes::Matrix &old_center)
see BundleModel::apply_modfication()
CH_Matrix_Classes::Integer function_id
-1 if not initialized, otherwise the maximum of the identifiers returned by the various calls to eval...
Definition: SumModel.hxx:87
virtual CH_Tools::Microseconds get_preeval_time() const
see SumBlockModel::get_preeval_time()
Definition: SumModel.hxx:411
int update_model(ModelUpdate model_update, CH_Matrix_Classes::Integer center_id, const CH_Matrix_Classes::Matrix ¢er_y, CH_Matrix_Classes::Integer cand_id, const CH_Matrix_Classes::Matrix &cand_y, CH_Matrix_Classes::Real model_maxviol, BundleProxObject &H)
see BundleModel::update_model
basic function object (abstract class). It serves for using the same interface on distinct oracle typ...
Definition: CBSolver.hxx:236
ModelData(SumBlockModel *oracle_model)
sets the oracle_model
SumBundle::Mode & set_suggested_mode()
get and set the sumbundle mode suggested to the model of the function
Definition: SumModel.hxx:136
abstract interface extension of QPModelDataObject for use in SumModel where several blocks are concat...
Definition: QPModelDataObject.hxx:105
In Lagrangean relaxation an approximate primal solution can be generated by supplying primal informat...
Definition: CBSolver.hxx:151
Collects modifications for the unconstrained Groundset for appending, deleting or reassigning variabl...
Definition: GroundsetModification.hxx:32
friend SumModel
SumModel may access any of this directly.
Definition: SumModel.hxx:82
int recompute_center(CH_Matrix_Classes::Integer &new_center_ub_fid, CH_Matrix_Classes::Real &new_center_ub, CH_Matrix_Classes::Integer center_id, const CH_Matrix_Classes::Matrix &y, bool accept_only_higher_values=false, CH_Matrix_Classes::Real relprec=-1.)
see BundleModel::recompute_center
CH_Matrix_Classes::Real model_curvature
for judging whether to use a local model or to suggest contribution to summodel, an estimate of retur...
Definition: SumModel.hxx:102
Interface for extending PrimalData, e.g., in Lagrangian relaxation of column generation approaches...
Definition: CBSolver.hxx:180
MinorantPointer center_minorant
the minorant in the center (if collected explicitly)
Definition: SumModel.hxx:166
CH_Matrix_Classes::Real lb_function(CH_Matrix_Classes::Integer y_id, const CH_Matrix_Classes::Matrix &y)
see SumBlockModel::lb_function()
base class for use with SumBlockModel for storing and managing essential data of evaluations and the ...
Definition: BundleData.hxx:77
SumBlockModel * oracle_model
this oracle model is part of the sum, it will NOT be deleted on exit
Definition: SumModel.hxx:85
BundleData * get_data()
see SumBlockModel::get_data()
Definition: SumModel.hxx:346
SumBlockModel * sbm_transform()
like BundleModel::transform() this allows SumBlockModel routines to use a given transformation automa...
int check_center_validity_by_candidate(bool &cand_minorant_is_below, CH_Matrix_Classes::Integer center_id, const CH_Matrix_Classes::Matrix ¢er_y)
see BundleModel::check_center_validity_by_candidate
CH_Matrix_Classes::Real get_model_curvature() const
get recent estimate of the function's "curvature" in candidate
Definition: SumModel.hxx:124
points to MinorantUseData that may be shared by many and allows computations with Minorants ...
Definition: MinorantPointer.hxx:34
int add_model(SumBlockModel *model)
adds the model as submodel to this model (if this model may have submodels); if any error occurs the ...
const PrimalData * get_candidate_primal() const
this has no primals, so it returns 1, see SumBlockModel::get_candidate_primal
Definition: SumModel.hxx:368
SumBundle::Mode suggested_mode
suggested mode for this model set by the last call to SumModelSelection::select_model() ...
Definition: SumModel.hxx:108
CH_Matrix_Classes::Real get_model_deviation() const
get recent difference between model and function value in candidate
Definition: SumModel.hxx:120
CH_Matrix_Classes::Integer nsubmodels() const
returns the number of submodels in this model
Definition: SumModel.hxx:191
const BundleParameters * get_bundle_parameters() const
see SumBlockModel::get_bundle_parameters()
virtual int call_primal_extender(PrimalExtender &)
this has no primals, so it returns 1, see SumBlockModel::call_primal_extender
Definition: SumModel.hxx:371
CH_Matrix_Classes::Real deviation_contribution
for judging whether to use a local model or to suggest contribution to summodel, this is changed/upda...
Definition: SumModel.hxx:99