ConicBundle
BoxData.hxx
Go to the documentation of this file.
1 
2 
3 #ifndef CONICBUNDLE_BOXDATA_HXX
4 #define CONICBUNDLE_BOXDATA_HXX
5 
6 
15 #include "BundleData.hxx"
16 #include "MatrixCBSolver.hxx"
17 #include "BoxOracle.hxx"
18 
19 namespace ConicBundle {
20 
25 
29 class BoxData:public BundleData
30 {
31 private:
32  friend class BoxModel;
33 
34 
35  //===== variables =====
36  //CH_Matrix_Classes::Integer dim; ///< the incoming dimension, once it is detected, -1 if not yet clear (some need it, but it is mainly for consistency checks and should be initialized in eval_function, lb_function, recompute_center, and updated in apply_modification)
37 
38  //FunctionTask function_task;
39  //CH_Matrix_Classes::Real function_factor; ///< >0, interpreted according to function_task
40 
41  //CH_Matrix_Classes::Integer modification_id; ///< increased on any modification applied to the function or @a function_factor
42 
43  //CH_Matrix_Classes::Integer center_ub_mid; ///< modification id for which center_ub was computed, <0 if not initialized
44  //CH_Matrix_Classes::Real center_ub; ///< upper bound on function value for modification id center_mid and center with point id center_id
45  //CH_Matrix_Classes::Real center_relprec; ///< relative precision used in computing center_ub
48 
49  //CH_Matrix_Classes::Integer cand_ub_mid; ///< modification id for which cand_ub was computed, <0 if not initialized
50  //CH_Matrix_Classes::Real cand_ub; ///< upper bound on function value for modification id cand_mid and candidate with point id cand_id
51  //CH_Matrix_Classes::Real cand_relprec; ///< relative precision used in computing cand_ub
52  //CH_Matrix_Classes::Integer cand_id; ///< point id of the stored candidate
55 
56  //CH_Matrix_Classes::Integer aggregate_id; ///< if available and ids match, the aggregate need not be recomputed
57  //MinorantPointer aggregate; ///< the aggregate linear minorant of the model (including @a function_factor and @a function_task)
58 
61 
62  //SumBundle sumbundle;
63 
64  //CH_Matrix_Classes::Integer max_old_minorants; ///< ==0 by default, otherwise it gives the maximum number of the most recent candidate minorants to be stored
65  //MinorantBundle old_minorants; ///< minorants collected for scaling and no other purposes, holds the at most max_old_minorants most recent candidate minorants
66 
67  //CH_Matrix_Classes::Matrix old_lowrank; ///< used by the dynamic scaling low rank heuristic (without function_factor)
68  //CH_Matrix_Classes::Matrix old_diagonal; ///< used by the dynamic scaling low rank heuristic (without function_factor)
69  //CH_Matrix_Classes::Symmatrix old_sym; ///< used by the dynamic scaling heuristic
70  //CH_Matrix_Classes::Integer minorant_nexti; ///< used by the dynamic scaling low rank heuristic
71 
72 
73  //the bundle is initialized if bundle.size()>0 (each subg might be of length 0!)
74 
78 
81 
85 
87 
89 
90 
92 
93 public:
94  //===== methods =====
96  ~BoxData();
97 
99  void clear(CH_Matrix_Classes::Integer start_modification_id=0);
100 
102  BoxData(CH_Matrix_Classes::Real fun_factor=1.,FunctionTask fun_task=ObjectiveFunction);
103 
105  int init(const BundleData* bd);
106 
108  BundleData* clone() const;
109 
111  int do_step(CH_Matrix_Classes::Integer point_id);
112 
114  int synchronize_ids(CH_Matrix_Classes::Integer& new_center_ub_fid,
115  CH_Matrix_Classes::Integer new_center_id,
116  CH_Matrix_Classes::Integer old_center_id,
117  CH_Matrix_Classes::Integer& new_cand_ub_fid,
118  CH_Matrix_Classes::Integer new_cand_id,
119  CH_Matrix_Classes::Integer old_cand_id,
120  CH_Matrix_Classes::Integer& new_aggregate_id,
121  CH_Matrix_Classes::Integer new_prex_id=0);
122 
123  //int center_modified() // as in BundleData
124 
125  //int model_aggregate_modified() // as in BundleData
126 
128  void clear_model(bool discard_minorants_only=false);
129 
131  void clear_aggregates();
132 
134  int call_primal_extender(PrimalExtender& prex,bool include_candidates=true);
135 
138 
140  const PrimalData* get_approximate_primal() const;
141 
143  const PrimalData* get_center_primal() const;
144 
146  const PrimalData* get_candidate_primal() const;
147 
148 
149 };
150 
151 
153 
154 }
155 
156 #endif
157 
int Integer
all integer numbers in calculations and indexing are of this type
Definition: matop.hxx:40
BoxData(CH_Matrix_Classes::Real fun_factor=1., FunctionTask fun_task=ObjectiveFunction)
initializes BundleData, sets center_primal to NULL and calls clear()
CH_Matrix_Classes::Matrix boxbundle_complvalues
the aggregate values in the complement (if not empty)
Definition: BoxData.hxx:80
If in Lagrangean relaxation primal solutions are in the form of a real vector or, more generally a ma...
Definition: MatrixCBSolver.hxx:211
MinorantPointer center_minorant
the (eps-)subgradient linear minorant in the center (available if valid and center_ub_mid is the modi...
Definition: BoxData.hxx:46
CH_Matrix_Classes::Real aggr_scaleval
the aggregate with function_factor is aggr_boxvec*aggr_scaleval;
Definition: BoxData.hxx:60
double Real
all real numbers in calculations are of this type
Definition: matop.hxx:50
Interface for extending a Minorant, e.g., in Lagrangian Relaxation of cutting plane approaches...
Definition: CBSolver.hxx:490
const PrimalData * get_approximate_primal() const
return the PrimalData corresponding to the aggregate
Matrix class for integral values of type Integer
Definition: indexmat.hxx:195
const PrimalData * get_center_primal() const
return the PrimalData corresponding to the aggregate
bool outside_bundle
true if nncbundle and nncbundle_coeff are initialized from an external source, e.g by a request to sw...
Definition: BoxData.hxx:86
PrimalMatrix center_boxvec
the maximizer over the box for the current center (without function_factor)
Definition: BoxData.hxx:47
conic bundle method solver for sum of convex functions. See the ConicBundle_Manual for a quick introd...
Definition: CBSolver.hxx:22
CH_Matrix_Classes::Matrix primal_nnctapia
indicators for activity of minorants
Definition: BoxData.hxx:84
MinorantBundle nncbundle
if the boxbundle is empty, this holds the aggregate (if available) and the candidate (always); if the...
Definition: BoxData.hxx:82
implements (as a derived class of ConeModel) a standard cutting plane model for a MatrixBoxOracle ...
Definition: BoxModel.hxx:28
int init(const BundleData *bd)
if bd is of type BoxData, initialize to this data
Header declaring the classes ConicBundle::BoxOracle and ConicBundle::BoxBundleParameters (needed for ...
CH_Matrix_Classes::Matrix boxbundle_coeff
coefficients of BoxBlock determined in last BundleMethod::eval_augmodel
Definition: BoxData.hxx:76
void clear_model(bool discard_minorants_only=false)
clear the cutting model and all function evaluations
PrimalMatrix aggr_boxvec
the primal aggregate vector in the box (without function_factor) giving rise to the aggregate; not in...
Definition: BoxData.hxx:59
void clear(CH_Matrix_Classes::Integer start_modification_id=0)
reset to initial state (also used by the default constructor)
PrimalMatrix cand_boxvec
the maximizer over the box for the current candidate
Definition: BoxData.hxx:54
MinorantPointer cand_minorant
the (eps)sugradient linear minorant returned by eval_function for the candidate (available if valid a...
Definition: BoxData.hxx:53
extends BundleData for use with BoxModel by adding information on subgradients and the cutting plane ...
Definition: BoxData.hxx:29
Header declaring the class ConicBundle::BundleData (see ConicBundle::SumBlockModel) ...
CH_Matrix_Classes::Matrix coord_switching
keeps track of which coordinates where changing the most in the past
Definition: BoxData.hxx:88
Matrix class for real values of type Real
Definition: matrix.hxx:74
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, CH_Matrix_Classes::Integer new_prex_id=0)
synchronize ids in any case by discarding inconsistent parts but return number of errors ...
FunctionTask
Each function represented by a FunctionModel is equipped with a function_factor (it defaults to 1...
Definition: CBSolver.hxx:221
std::vector< MinorantPointer > MinorantBundle
a bundle is a vector with MinorantPointer entries
Definition: MinorantPointer.hxx:24
~BoxData()
calls clear()
MinorantBundle boxbundle
the bundle holds the minorants describing the BoxBlock part of the model for selected coordinates and...
Definition: BoxData.hxx:75
int call_primal_extender(PrimalExtender &prex, bool include_candidates=true)
see the last argument of BoxOracle::evaluate()
Header declaring the classes ConicBundle::MatrixCBSolver, ConicBundle::MatrixFunctionOracle, ConicBundle::PrimalMatrix, ConicBundle::MatrixMinorant, ConicBundle::ModifiableOracleObject.
int do_step(CH_Matrix_Classes::Integer point_id)
if the candidate information is available and consitent for point_id, copy it from cand to center and...
void clear_aggregates()
remove all aggregate minorants
In Lagrangean relaxation an approximate primal solution can be generated by supplying primal informat...
Definition: CBSolver.hxx:151
CH_Matrix_Classes::Matrix primal_boxtapia
indicators for activity of minorants
Definition: BoxData.hxx:77
Collects modifications for the unconstrained Groundset for appending, deleting or reassigning variabl...
Definition: GroundsetModification.hxx:32
Interface for extending PrimalData, e.g., in Lagrangian relaxation of column generation approaches...
Definition: CBSolver.hxx:180
CH_Matrix_Classes::Matrix nncbundle_coeff
coefficients determined in last BundleMethod::eval_augmodel
Definition: BoxData.hxx:83
base class for use with SumBlockModel for storing and managing essential data of evaluations and the ...
Definition: BundleData.hxx:77
const PrimalData * get_candidate_primal() const
return the PrimalData delivered by the last call of BoxOracle::evaluate()
CH_Matrix_Classes::Integer prex_id
counter for keeping track of PriamlExtender calls
Definition: BoxData.hxx:91
BundleData * clone() const
return a pointer to a clone of this
points to MinorantUseData that may be shared by many and allows computations with Minorants ...
Definition: MinorantPointer.hxx:34
int apply_modification(const GroundsetModification &, MinorantExtender *mex)
rearrange/extend the minorants according to the given groundset modifications
CH_Matrix_Classes::Indexmatrix boxbundle_coords
the coordinates selected to have their full box range in the model
Definition: BoxData.hxx:79