ConicBundle
ModificationTreeData.hxx
Go to the documentation of this file.
1 
2 
3 
4 #ifndef CONICBUNDLE_MODIFICATIONTREEDATA_HXX
5 #define CONICBUNDLE_MODIFICATIONTREEDATA_HXX
6 
7 
17 
18 namespace ConicBundle {
19 
23 
24 class SumBlockModel;
26 
29 typedef std::map<const FunctionObject*, ModificationTreeData*> FunctionMap;
30 
31 
37 {
38 private:
39  //-----------------------------------------------------------------------
43 
47 
49  FunctionMap children;
50 
52 
53  //-----------------------------------------------------------------------
57 
60  OracleModification* oraclemod;
61 
63 
64  //-----------------------------------------------------------------------
65 
66 public:
67 
73  FunctionObject* wr,
74  SumBlockModel* sbm,
75  CH_Matrix_Classes::Integer groundset_dim,
76  CH_Matrix_Classes::Integer fun_dim_fixed,
78  const CBout* cb);
79 
82 
84  SumBlockModel* get_model() const {return model;}
85 
87  bool modification_pending() const;
88 
90  bool
94  CH_Matrix_Classes::Integer& append_dim,
95  const CH_Matrix_Classes::Indexmatrix*& map_to_old,
96  const CH_Matrix_Classes::Indexmatrix*& deleted_indices,
97  const CH_Matrix_Classes::Indexmatrix*& new_indices,
98  const OracleModification*& oracle_modification
99  ) const;
100 
103 
105  int unlink_subtree();
106 
108  int delete_descendants(FunctionMap& funmap);
109 
111  int add_parents_to_map(FunObjModMap& funmodmap);
112 
125  const CH_Matrix_Classes::Indexmatrix* map_to_old,
126  const FunObjModMap* modmap);
127 
130 
133 
136 
138  void set_cbout(const CBout* cb,int incr=-1);
139 
140 };
141 
142 
144 
145 }
146 
147 #endif
148 
int Integer
all integer numbers in calculations and indexing are of this type
Definition: matop.hxx:40
Base class for informing oracles (or the solver) about dynamic changes in the number and sorting of t...
Definition: CBSolver.hxx:544
int update_subtree_modification(CH_Matrix_Classes::Integer add_dim, const CH_Matrix_Classes::Indexmatrix *map_to_old, const FunObjModMap *modmap)
starting from the root recursively collect the required modifications in each node and propagate them...
abstract interface extending BundleModel so that any such model can be used alone or within SumModel ...
Definition: SumBlockModel.hxx:102
int collect_subtree_modification(FunObjModMap &modmap)
recursively add modifications whenever they deviate from default modifications referenced by wrapper ...
ModificationTreeData * parent
if the function is part of parent function (sum,...), this points to it
Definition: ModificationTreeData.hxx:48
Matrix class for integral values of type Integer
Definition: indexmat.hxx:195
int add_parents_to_map(FunObjModMap &funmodmap)
Recursively add the parent node of this to funmodmap if it is not yet in there (the purpose is to pro...
int clear_subtree_modification()
recursively clear all pending modifications without being executed, i.e., go back to the state withou...
SumBlockModel * get_model() const
returns the model
Definition: ModificationTreeData.hxx:84
std::map< const FunctionObject *, ModificationTreeData * > FunctionMap
this serves either as searchable storage for nodes on the heap or as an adjacency list of adjacent no...
Definition: ModificationTreeData.hxx:25
conic bundle method solver for sum of convex functions. See the ConicBundle_Manual for a quick introd...
Definition: CBSolver.hxx:22
CH_Matrix_Classes::Integer fixed_dimension
if negative, this means not fixed, otherwise this is the number of parameters and they may never be i...
Definition: ModificationTreeData.hxx:58
base class for uniform use of WARNINGS and ERRORS (at some point in time)
Definition: CBout.hxx:30
FunctionMap children
if the function consists of several subfunctions, these are pointed to here
Definition: ModificationTreeData.hxx:49
Header declaring the classes ConicBundle::FunctionObjectModification and ConicBundle::FunObjModMap.
bool modification_pending() const
returns true if some modifications have been collected and need to be executed
~ModificationTreeData()
destructor, does not delete the oracle but the model and the wrapper (if there is one) and assumes th...
AFTModification aftmod
this also gives an account of all modifications of the ground set of the oracle via its rows ...
Definition: ModificationTreeData.hxx:59
Represents a tree node of the tree within MatrixCBSolver that describes the problem with its interact...
Definition: ModificationTreeData.hxx:36
collects modifications for an AffineFunctionTransformation for the scaling and offset constants as we...
Definition: AFTModification.hxx:31
int delete_descendants(FunctionMap &funmap)
recursively remove all tree nodes of the subtree (except for this) from funmap and destruct/delete th...
ModificationTreeData(const FunctionObject *fo, FunctionObject *wr, SumBlockModel *sbm, CH_Matrix_Classes::Integer groundset_dim, CH_Matrix_Classes::Integer fun_dim_fixed, AffineFunctionTransformation *aft, const CBout *cb)
initialize the function object with its dimension, possibly with AFT and dynamic settings, its model, possibly with an oracle wrapper if required, and output settings
std::map< const FunctionObject *, FunctionObjectModification > FunObjModMap
In order to pass on problem modifications, FunObjModMap allows to specify a FunctionObjectModificatio...
Definition: FunctionObjectModification.hxx:104
int add_child(ModificationTreeData *fmd)
add a child (possibly holding a subtree) to this node and to the corresponding model; if any error oc...
bool pending_oracle_modification(CH_Matrix_Classes::Integer &old_dim, CH_Matrix_Classes::Integer &new_dim, CH_Matrix_Classes::Integer &append_dim, const CH_Matrix_Classes::Indexmatrix *&map_to_old, const CH_Matrix_Classes::Indexmatrix *&deleted_indices, const CH_Matrix_Classes::Indexmatrix *&new_indices, const OracleModification *&oracle_modification) const
returns true if some modifications have been collected and need to be executed
basic function object (abstract class). It serves for using the same interface on distinct oracle typ...
Definition: CBSolver.hxx:236
void set_cbout(const CBout *cb, int incr=-1)
set output levels for this, wrapper, model and aftmod
SumBlockModel * model
the model used for funobject or its wrapper
Definition: ModificationTreeData.hxx:46
transform a function f(z) to fun_coeff*f(arg_offset+arg_trafo*y)+linear_cost*y+fun_offset (scales the...
Definition: AffineFunctionTransformation.hxx:68
int unlink_subtree()
remove the subtree rooted at this node from the parent of this but do not delete it ...
FunctionObject * wrapper
if !=funobject, the function is wrapped in *wrapper as an oracle interface
Definition: ModificationTreeData.hxx:45
int subtree_modification_performed()
set the data to the state achieved by executing the stored modifications, no modifications are pendin...
Header declaring the classes ConicBundle::AffineFunctionTransformation.
const FunctionObject * funobject
the actual function object, i.e. the oracle
Definition: ModificationTreeData.hxx:44