ConicBundle
SOCData.hxx
Go to the documentation of this file.
1 
2 
3 #ifndef CONICBUNDLE_SOCDATA_HXX
4 #define CONICBUNDLE_SOCDATA_HXX
5 
6 
15 #include "BundleData.hxx"
16 
17 namespace ConicBundle {
18 
23 
43 class SOCData:public BundleData
44 {
45 private:
46  friend class SOCModel;
47 
48  //===== variables =====
49  //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)
50  //FunctionTask function_task;
51  //CH_Matrix_Classes::Real function_factor; ///< >0, interpreted according to function_task
52 
53  //CH_Matrix_Classes::Integer modification_id; ///< increased on any modification applied to the function
54 
55  //CH_Matrix_Classes::Integer center_ub_mid; ///< modification id for which center_ub was computed, <0 if not initialized
56  //CH_Matrix_Classes::Real center_ub; ///< upper bound on function value for modification id center_mid and center with point id center_id
57  //CH_Matrix_Classes::Real center_relprec; ///< relative precision used in computing center_ub
58  //CH_Matrix_Classes::Integer center_id; ///< point id of the stored center
62 
63 
64  //CH_Matrix_Classes::Integer cand_ub_mid; ///< modification id for which cand_ub was computed, <0 if not initialized
65  //CH_Matrix_Classes::Real cand_ub; ///< upper bound on function value for modification id cand_mid and candidate with point id cand_id
66  //CH_Matrix_Classes::Real cand_relprec; ///< relative precision used in computing cand_ub
67  //CH_Matrix_Classes::Integer cand_id; ///< point id of the stored candidate
71 
72  //CH_Matrix_Classes::Integer aggregate_id;
73  //MinorantPointer local_aggregate; ///< the local (possibly empty) aggregate linear minorant of the model handled by this and its descendants (including @a function_factor and @a function_task)
74  //MinorantPointer aggregate; ///< the aggregate linear minorant of the model (including @a function_factor and @a function_task)
76 
77  //the bundle is initialized if bundlevecs.coldim()>0 (then it must have rowdim>0!)
79 
80 
84 
85  //SumBundle sumbundle;
86 
87 
88  //--- data needed for generic scaling
89  //CH_Matrix_Classes::Integer max_old_minorants;
90  //MinorantBundle old_minorants;
91  //CH_Matrix_Classes::Matrix old_lowrank;
92  //CH_Matrix_Classes::Matrix old_diagonal;
93  //CH_Matrix_Classes::Symmatrix old_sym;
94  //CH_Matrix_Classes::Integer minorant_nexti;
95 
96 public:
97 
98  //===== methods =====
100  ~SOCData();
101 
103  void clear(CH_Matrix_Classes::Integer start_modification_id=0);
104 
106  SOCData(CH_Matrix_Classes::Real fun_factor=1.,FunctionTask fun_task=ObjectiveFunction);
107 
109  int init(const BundleData* bd);
110 
112  BundleData* clone() const;
113 
115  int do_step(CH_Matrix_Classes::Integer point_id);
116 
117  //int store_old_minorant(MinorantPointer& minorant); //as in Bundledata
118 
120  virtual int store_SOCvec(const CH_Matrix_Classes::Matrix& SOCvec);
121 
124 
126  int synchronize_ids(CH_Matrix_Classes::Integer& new_center_ub_fid,
127  CH_Matrix_Classes::Integer new_center_id,
128  CH_Matrix_Classes::Integer old_center_id,
129  CH_Matrix_Classes::Integer& new_cand_ub_fid,
130  CH_Matrix_Classes::Integer new_cand_id,
131  CH_Matrix_Classes::Integer old_cand_id,
132  CH_Matrix_Classes::Integer& new_aggregate_id,
133  CH_Matrix_Classes::Integer new_prex_id=0);
134 
135  //int center_modified() // as in BundleData
136 
137  //int model_aggregate_modified() // as in BundleData
138 
141 
143  void clear_model(bool discard_minorants_only=false);
144 
146  void clear_aggregates();
147 
149  int call_primal_extender(PrimalExtender&,bool include_candidates=true);
150 
153 
155  const PrimalData* get_approximate_primal() const;
156 
158  const PrimalData* get_center_primal() const;
159 
161  const PrimalData* get_candidate_primal() const;
162 
164  virtual int get_latest_minorants(MinorantBundle& latest_minorants,
165  CH_Matrix_Classes::Integer max_number);
166 
167 };
168 
169 
171 
172 }
173 
174 #endif
175 
int Integer
all integer numbers in calculations and indexing are of this type
Definition: matop.hxx:40
CH_Matrix_Classes::Matrix SOCvecs
collects the barx parts of the old SOCvecs
Definition: SOCData.hxx:81
virtual int store_SOCvec(const CH_Matrix_Classes::Matrix &SOCvec)
if max_old_minorants > 0, it adds the SOCvec cyclically to SOCvecs keeping max_old_minorants of them ...
CH_Matrix_Classes::Integer SOCvecs_max
upper bound on stored SOCvecs
Definition: SOCData.hxx:82
double Real
all real numbers in calculations are of this type
Definition: matop.hxx:50
virtual int get_latest_minorants(MinorantBundle &latest_minorants, CH_Matrix_Classes::Integer max_number)
return the max_number latest minorants if available;
MinorantPointer center_minorant
if not empty it matches center_SOCvec
Definition: SOCData.hxx:61
CH_Matrix_Classes::Matrix center_SOCvec
the SOCvector generating center_SOCval
Definition: SOCData.hxx:60
Interface for extending a Minorant, e.g., in Lagrangian Relaxation of cutting plane approaches...
Definition: CBSolver.hxx:490
implements (as a derived class of ConeModel) a cutting model for a SOCOracle
Definition: SOCModel.hxx:44
MinorantPointer cand_minorant
if not empty, it matches cand_SOCvec
Definition: SOCData.hxx:70
CH_Matrix_Classes::Matrix primalvec
current aggregate soc vector (includes function_factor and function_task); if not valid it has coldim...
Definition: SOCData.hxx:75
CH_Matrix_Classes::Real center_SOCval
lower bound on the center value
Definition: SOCData.hxx:59
int init(const BundleData *bd)
if bd is of type SOCData, initialize to this data
CH_Matrix_Classes::Matrix bundlevecs
the columns span the subspace of the SOC face (the bundle is initialized if bundlevecs.coldim()>0)
Definition: SOCData.hxx:78
conic bundle method solver for sum of convex functions. See the ConicBundle_Manual for a quick introd...
Definition: CBSolver.hxx:22
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 ...
const PrimalData * get_approximate_primal() const
return the PrimalData corresponding to the aggregate
void clear_model_except_bundlevecs()
clear all function evaluations and aggregates, but not the collected subspace information ...
CH_Matrix_Classes::Integer SOCvecs_nexti
points at next "free" column
Definition: SOCData.hxx:83
int call_primal_extender(PrimalExtender &, bool include_candidates=true)
see the last argument of FunctionOracle::evaluate()
CH_Matrix_Classes::Matrix cand_SOCvec
the SOCvector generating cand_SOCval
Definition: SOCData.hxx:69
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...
~SOCData()
calls clear()
void clear_model(bool discard_minorants_only=false)
clear the cutting model and all function evaluations
Header declaring the class ConicBundle::BundleData (see ConicBundle::SumBlockModel) ...
int form_bundlevecs(CH_Matrix_Classes::Integer max_columns)
starting with aggregate and cand_SOCvec add further ones as needed
Matrix class for real values of type Real
Definition: matrix.hxx:74
FunctionTask
Each function represented by a FunctionModel is equipped with a function_factor (it defaults to 1...
Definition: CBSolver.hxx:221
CH_Matrix_Classes::Real cand_SOCval
lower bound on the candidate value
Definition: SOCData.hxx:68
std::vector< MinorantPointer > MinorantBundle
a bundle is a vector with MinorantPointer entries
Definition: MinorantPointer.hxx:24
BundleData * clone() const
return a pointer to a clone of this
const PrimalData * get_center_primal() const
return the PrimalData corresponding to the aggregate
int apply_modification(const GroundsetModification &, MinorantExtender *mex)
rearrange/extend the minorants according to the given groundset modifications
In Lagrangean relaxation an approximate primal solution can be generated by supplying primal informat...
Definition: CBSolver.hxx:151
SOCData(CH_Matrix_Classes::Real fun_factor=1., FunctionTask fun_task=ObjectiveFunction)
calls clear()
Collects modifications for the unconstrained Groundset for appending, deleting or reassigning variabl...
Definition: GroundsetModification.hxx:32
void clear(CH_Matrix_Classes::Integer start_modification_id=0)
reset to initial state (also used by the default constructor)
extends BundleData for use with SOCModel (see there for the description of the function) by adding in...
Definition: SOCData.hxx:43
Interface for extending PrimalData, e.g., in Lagrangian relaxation of column generation approaches...
Definition: CBSolver.hxx:180
const PrimalData * get_candidate_primal() const
return the PrimalData delivered by the last call of FunctionOracle::evaluate()
base class for use with SumBlockModel for storing and managing essential data of evaluations and the ...
Definition: BundleData.hxx:77
points to MinorantUseData that may be shared by many and allows computations with Minorants ...
Definition: MinorantPointer.hxx:34
void clear_aggregates()
delete all kinds of aggregates but keep explicit parts of the cutting model