ConicBundle
NNCData.hxx
Go to the documentation of this file.
1 
2 
3 #ifndef CONICBUNDLE_NNCDATA_HXX
4 #define CONICBUNDLE_NNCDATA_HXX
5 
6 
15 #include "BundleData.hxx"
16 
17 namespace ConicBundle {
18 
23 
27 class NNCData:public BundleData
28 {
29 private:
30  friend class NNCModel;
31 
32  //===== variables =====
33  //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)
34  //FunctionTask function_task;
35  //CH_Matrix_Classes::Real function_factor; ///< >0, interpreted according to function_task
36 
37  //CH_Matrix_Classes::Integer modification_id; ///< increased on any modification applied to the function or @a function_factor
38 
39  //CH_Matrix_Classes::Integer center_ub_mid; ///< modification id for which center_ub was computed, <0 if not initialized
40  //CH_Matrix_Classes::Real center_ub; ///< upper bound on function value for modification id center_mid and center with point id center_id
41  //CH_Matrix_Classes::Real center_relprec; ///< relative precision used in computing center_ub
43 
44 
45  //CH_Matrix_Classes::Integer cand_ub_mid; ///< modification id for which cand_ub was computed, <0 if not initialized
46  //CH_Matrix_Classes::Real cand_ub; ///< upper bound on function value for modification id cand_mid and candidate with point id cand_id
47  //CH_Matrix_Classes::Real cand_relprec; ///< relative precision used in computing cand_ub
48  //CH_Matrix_Classes::Integer cand_id; ///< point id of the stored candidate
51 
52  //CH_Matrix_Classes::Integer aggregate_id; ///< if available and ids match, the aggregate need not be recomputed
53  //MinorantPointer aggregate; ///< the aggregate linear minorant of the model (including @a function_factor and @a function_task)
54 
55  //SumBundle sumbundle;
56 
57  //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
58  //MinorantBundle old_minorants; ///< minorants collected for scaling and no other purposes, holds the at most max_old_minorants most recent candidate minorants
59 
60  //CH_Matrix_Classes::Matrix old_lowrank; ///< used by the dynamic scaling low rank heuristic (without function_factor)
61  //CH_Matrix_Classes::Matrix old_diagonal; ///< used by the dynamic scaling low rank heuristic (without function_factor)
62  //CH_Matrix_Classes::Symmatrix old_sym; ///< used by the dynamic scaling heuristic
63  //CH_Matrix_Classes::Integer minorant_nexti; ///< used by the dynamic scaling low rank heuristic
64 
65 
66  //the bundle is initialized if bundle.size()>0 (each subg might be of length 0!)
67 
70 
71 
73 
75 
76 
77 public:
78 
79  //===== methods =====
81  ~NNCData();
82 
84  void clear(CH_Matrix_Classes::Integer start_modification_id=0);
85 
87  NNCData(CH_Matrix_Classes::Real fun_factor=1.,FunctionTask fun_task=ObjectiveFunction);
88 
90  int init(const BundleData* bd);
91 
93  BundleData* clone() const;
94 
96  int do_step(CH_Matrix_Classes::Integer point_id);
97 
99  int synchronize_ids(CH_Matrix_Classes::Integer& new_center_ub_fid,
100  CH_Matrix_Classes::Integer new_center_id,
101  CH_Matrix_Classes::Integer old_center_id,
102  CH_Matrix_Classes::Integer& new_cand_ub_fid,
103  CH_Matrix_Classes::Integer new_cand_id,
104  CH_Matrix_Classes::Integer old_cand_id,
105  CH_Matrix_Classes::Integer& new_aggregate_id,
106  CH_Matrix_Classes::Integer new_prex_id=0);
107 
108  //int center_modified() // as in BundleData
109 
110  //int model_aggregate_modified() // as in BundleData
111 
113  void clear_model(bool discard_minorants_only=false);
114 
116  void clear_aggregates();
117 
119  int call_primal_extender(PrimalExtender& prex,bool include_candidates=true);
120 
123 
125  const PrimalData* get_approximate_primal() const;
126 
128  const PrimalData* get_center_primal() const;
129 
131  const PrimalData* get_candidate_primal() const;
132 
134  virtual int get_model_data(MinorantBundle& model_minorants,
135  CH_Matrix_Classes::Matrix& model_coeff) const
136  {
137  model_minorants=bundle;
138  model_coeff=bundlecoeff;
139  return 0;
140  }
141 
142 
143 };
144 
145 
147 
148 }
149 
150 #endif
151 
int Integer
all integer numbers in calculations and indexing are of this type
Definition: matop.hxx:40
double Real
all real numbers in calculations are of this type
Definition: matop.hxx:50
~NNCData()
calls clear()
MinorantBundle bundle
the bundle holds the minorants describing the model
Definition: NNCData.hxx:72
Interface for extending a Minorant, e.g., in Lagrangian Relaxation of cutting plane approaches...
Definition: CBSolver.hxx:490
int call_primal_extender(PrimalExtender &prex, bool include_candidates=true)
see the last argument of FunctionOracle::evaluate()
BundleData * clone() const
return a pointer to a clone of this
implements (as a derived class of SumBlockModel) a standard cutting plane model for a MatrixFunctionO...
Definition: NNCModel.hxx:28
CH_Matrix_Classes::Matrix primal_tapia
indicators for activity of minorants
Definition: NNCData.hxx:69
virtual int get_model_data(MinorantBundle &model_minorants, CH_Matrix_Classes::Matrix &model_coeff) const
the minorants currently used in the model; the list may be empty or max contain other minorants than ...
Definition: NNCData.hxx:134
conic bundle method solver for sum of convex functions. See the ConicBundle_Manual for a quick introd...
Definition: CBSolver.hxx:22
int init(const BundleData *bd)
if bd is of type NNCData, initialize to this data
int apply_modification(const GroundsetModification &, MinorantExtender *mex)
rearrange/extend the minorants according to the given groundset modifications
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 ...
void clear(CH_Matrix_Classes::Integer start_modification_id=0)
reset to initial state (also used by the default constructor)
NNCData(CH_Matrix_Classes::Real fun_factor=1., FunctionTask fun_task=ObjectiveFunction)
initializes BundleData, sets center_primal to NULL and calls clear()
void clear_aggregates()
remove all aggregate minorants
extends BundleData for use with FunctionModel by adding information on subgradients and the cutting p...
Definition: NNCData.hxx:27
const PrimalData * get_center_primal() const
return the PrimalData corresponding to the aggregate
Header declaring the class ConicBundle::BundleData (see ConicBundle::SumBlockModel) ...
Matrix class for real values of type Real
Definition: matrix.hxx:74
CH_Matrix_Classes::Matrix bundlecoeff
coefficients determined in last BundleMethod::eval_augmodel
Definition: NNCData.hxx:68
FunctionTask
Each function represented by a FunctionModel is equipped with a function_factor (it defaults to 1...
Definition: CBSolver.hxx:221
MinorantPointer center_minorant
the (eps-)subgradient linear minorant in the center (available if center_ub_mid is the modification i...
Definition: NNCData.hxx:42
std::vector< MinorantPointer > MinorantBundle
a bundle is a vector with MinorantPointer entries
Definition: MinorantPointer.hxx:24
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...
const PrimalData * get_candidate_primal() const
return the PrimalData delivered by the last call of FunctionOracle::evaluate()
MinorantPointer cand_minorant
the "best" (eps)sugradient linear minorant returned by eval_function (available if valid and cand_ub_...
Definition: NNCData.hxx:49
const PrimalData * get_approximate_primal() const
return the PrimalData corresponding to the aggregate
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
void clear_model(bool discard_minorants_only=false)
clear the cutting model and all function evaluations
Interface for extending PrimalData, e.g., in Lagrangian relaxation of column generation approaches...
Definition: CBSolver.hxx:180
base class for use with SumBlockModel for storing and managing essential data of evaluations and the ...
Definition: BundleData.hxx:77
MinorantBundle cand_minorants
the (eps)sugradient linear minorants returned by eval_function for the candidate (available if cand_u...
Definition: NNCData.hxx:50
points to MinorantUseData that may be shared by many and allows computations with Minorants ...
Definition: MinorantPointer.hxx:34
bool outside_bundle
true if bundle and bundlecoeff are initialized from an external source, e.g by a request to switch fr...
Definition: NNCData.hxx:74