ConicBundle
Public Member Functions | List of all members
ConicBundle::ModificationTreeData Class Reference

Represents a tree node of the tree within MatrixCBSolver that describes the problem with its interacting functions and that allows to collect modifications before executing them on the respective models. More...

#include <ModificationTreeData.hxx>

Inheritance diagram for ConicBundle::ModificationTreeData:
ConicBundle::CBout

Public Member Functions

 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 More...
 
 ~ModificationTreeData ()
 destructor, does not delete the oracle but the model and the wrapper (if there is one) and assumes that all children have been removed already
 
SumBlockModelget_model () const
 returns the model
 
bool modification_pending () const
 returns true if some modifications have been collected and need to be executed
 
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
 
int add_child (ModificationTreeData *fmd)
 add a child (possibly holding a subtree) to this node and to the corresponding model; if any error occurs the node/subtree is not added
 
int unlink_subtree ()
 remove the subtree rooted at this node from the parent of this but do not delete it
 
int delete_descendants (FunctionMap &funmap)
 recursively remove all tree nodes of the subtree (except for this) from funmap and destruct/delete them
 
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 propagate necessary modifications to the root)
 
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 to the children; More...
 
int collect_subtree_modification (FunObjModMap &modmap)
 recursively add modifications whenever they deviate from default modifications referenced by wrapper instead of funobject whenever it exists
 
int subtree_modification_performed ()
 set the data to the state achieved by executing the stored modifications, no modifications are pending afterwards (this does not change the models but only the modification data)
 
int clear_subtree_modification ()
 recursively clear all pending modifications without being executed, i.e., go back to the state without modifications
 
void set_cbout (const CBout *cb, int incr=-1)
 set output levels for this, wrapper, model and aftmod
 
- Public Member Functions inherited from ConicBundle::CBout
virtual void set_out (std::ostream *out=0, int print_level=1)
 Specifies the output level (out==NULL: no output at all, out!=NULL and level=0: errors and warnings, level>0 increasingly detailed information) More...
 
void clear_cbout ()
 reset to default settings (out=0,print_level=1)
 
 CBout (const CBout *cb=0, int incr=-1)
 calls set_cbout
 
 CBout (std::ostream *outp, int pl=1)
 initialize correspondingly
 
 CBout (const CBout &cb, int incr=0)
 copy constructor
 
virtual bool cb_out (int pl=-1) const
 Returns true if out!=0 and (pl<print_level), pl<0 should be used for WARNINGS and ERRORS only, pl==0 for usual output.
 
std::ostream & get_out () const
 If cb_out() returned true, this returns the output stream, but it will abort if called with out==0.
 
std::ostream * get_out_ptr () const
 returns the pointer to the output stream
 
int get_print_level () const
 returns the print_level
 
virtual int mfile_data (std::ostream &out) const
 writes problem data to the given outstream
 

Private Attributes

data for describing function properties and its place in the tree
const FunctionObjectfunobject
 the actual function object, i.e. the oracle
 
FunctionObjectwrapper
 if !=funobject, the function is wrapped in *wrapper as an oracle interface
 
SumBlockModelmodel
 the model used for funobject or its wrapper
 
ModificationTreeDataparent
 if the function is part of parent function (sum,...), this points to it
 
FunctionMap children
 if the function consists of several subfunctions, these are pointed to here
 
data needed for modifications
CH_Matrix_Classes::Integer fixed_dimension
 if negative, this means not fixed, otherwise this is the number of parameters and they may never be increased, reordered or reassigned
 
AFTModification aftmod
 this also gives an account of all modifications of the ground set of the oracle via its rows
 
OracleModificationoraclemod
 

Detailed Description

Represents a tree node of the tree within MatrixCBSolver that describes the problem with its interacting functions and that allows to collect modifications before executing them on the respective models.

Constructor & Destructor Documentation

◆ ModificationTreeData()

ConicBundle::ModificationTreeData::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

Member Function Documentation

◆ update_subtree_modification()

int ConicBundle::ModificationTreeData::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 to the children;

if modmap specifies modifications for this function object, they override add_dim and map_to_old. If no special modifications are given, add_dim is carried out before map_to_old. If add_dim==0 or map_to_old==0 there are no modifications of htis kind.

Independent of whether modifications at this level exist, the children are always called afterwards with the modifications resulting from the step at this level.

Referenced by get_model().


The documentation for this class was generated from the following file: