mlpack  master
Classes | Public Types | Public Member Functions | Private Attributes | List of all members
mlpack::tree::XTreeAuxiliaryInformation< TreeType > Class Template Reference

The XTreeAuxiliaryInformation class provides information specific to X trees for each node in a RectangleTree. More...

Classes

struct  SplitHistoryStruct
 The X tree requires that the tree records it's "split history". More...
 

Public Types

typedef struct mlpack::tree::XTreeAuxiliaryInformation::SplitHistoryStruct SplitHistoryStruct
 The X tree requires that the tree records it's "split history". More...
 

Public Member Functions

 XTreeAuxiliaryInformation ()
 Default constructor. More...
 
 XTreeAuxiliaryInformation (const TreeType *node)
 Construct this with the specified node. More...
 
 XTreeAuxiliaryInformation (const XTreeAuxiliaryInformation &other, TreeType *=NULL, bool=true)
 Create an auxiliary information object by copying from another object. More...
 
 XTreeAuxiliaryInformation (XTreeAuxiliaryInformation &&other)
 Create an auxiliary information object by moving from the other node. More...
 
bool HandleNodeInsertion (TreeType *, TreeType *, bool)
 Some tree types require to save some properties at the insertion process. More...
 
bool HandleNodeRemoval (TreeType *, const size_t)
 Some tree types require to save some properties at the deletion process. More...
 
bool HandlePointDeletion (TreeType *, const size_t)
 Some tree types require to save some properties at the deletion process. More...
 
bool HandlePointInsertion (TreeType *, const size_t)
 Some tree types require to save some properties at the insertion process. More...
 
size_t NormalNodeMaxNumChildren () const
 Return the maximum number of a normal node's children. More...
 
size_t & NormalNodeMaxNumChildren ()
 Modify the maximum number of a normal node's children. More...
 
void NullifyData ()
 Nullify the auxiliary information in order to prevent an invalid free. More...
 
XTreeAuxiliaryInformationoperator= (const XTreeAuxiliaryInformation &other)
 Copy the auxiliary information object. More...
 
template<typename Archive >
void Serialize (Archive &ar, const unsigned int)
 Serialize the information. More...
 
const SplitHistoryStructSplitHistory () const
 Return the split history of the node associated with this object. More...
 
SplitHistoryStructSplitHistory ()
 Modify the split history of the node associated with this object. More...
 
bool UpdateAuxiliaryInfo (TreeType *)
 Some tree types require to propagate the information upward. More...
 

Private Attributes

size_t normalNodeMaxNumChildren
 The max number of child nodes a non-leaf normal node can have. More...
 
SplitHistoryStruct splitHistory
 A struct to store the "split history" for X trees. More...
 

Detailed Description

template<typename TreeType>
class mlpack::tree::XTreeAuxiliaryInformation< TreeType >

The XTreeAuxiliaryInformation class provides information specific to X trees for each node in a RectangleTree.

Definition at line 24 of file x_tree_auxiliary_information.hpp.

Member Typedef Documentation

The X tree requires that the tree records it's "split history".

To make this easy, we use the following structure.

Constructor & Destructor Documentation

template<typename TreeType >
mlpack::tree::XTreeAuxiliaryInformation< TreeType >::XTreeAuxiliaryInformation ( )
inline

Default constructor.

Definition at line 28 of file x_tree_auxiliary_information.hpp.

template<typename TreeType >
mlpack::tree::XTreeAuxiliaryInformation< TreeType >::XTreeAuxiliaryInformation ( const TreeType *  node)
inline

Construct this with the specified node.

Parameters
nodeThe node that stores this auxiliary information.

Definition at line 38 of file x_tree_auxiliary_information.hpp.

template<typename TreeType >
mlpack::tree::XTreeAuxiliaryInformation< TreeType >::XTreeAuxiliaryInformation ( const XTreeAuxiliaryInformation< TreeType > &  other,
TreeType *  = NULL,
bool  = true 
)
inline

Create an auxiliary information object by copying from another object.

Parameters
otherAnother auxiliary information object from which the information will be copied.
treeThe node that holds the auxiliary information.
deepCopyIf false, the new object uses the same memory (not used here).

Definition at line 54 of file x_tree_auxiliary_information.hpp.

template<typename TreeType >
mlpack::tree::XTreeAuxiliaryInformation< TreeType >::XTreeAuxiliaryInformation ( XTreeAuxiliaryInformation< TreeType > &&  other)
inline

Create an auxiliary information object by moving from the other node.

Parameters
otherThe object from which the information will be moved.

Definition at line 79 of file x_tree_auxiliary_information.hpp.

Member Function Documentation

template<typename TreeType >
bool mlpack::tree::XTreeAuxiliaryInformation< TreeType >::HandleNodeInsertion ( TreeType *  ,
TreeType *  ,
bool   
)
inline

Some tree types require to save some properties at the insertion process.

This method allows the auxiliary information the option of manipulating the tree in order to perform the insertion process. If the auxiliary information does that, then the method should return true; if the method returns false the RectangleTree performs its default behavior.

Parameters
nodeThe node in which the nodeToInsert is being inserted.
nodeToInsertThe node being inserted.
insertionLevelThe level of the tree at which the nodeToInsert should be inserted.

Definition at line 113 of file x_tree_auxiliary_information.hpp.

template<typename TreeType >
bool mlpack::tree::XTreeAuxiliaryInformation< TreeType >::HandleNodeRemoval ( TreeType *  ,
const size_t   
)
inline

Some tree types require to save some properties at the deletion process.

This method allows the auxiliary information the option of manipulating the tree in order to perform the deletion process. If the auxiliary information does that, then the method should return true; if the method returns false the RectangleTree performs its default behavior.

Parameters
nodeThe node from which the node is being deleted.
nodeIndexThe local index of the node being deleted.

Definition at line 143 of file x_tree_auxiliary_information.hpp.

template<typename TreeType >
bool mlpack::tree::XTreeAuxiliaryInformation< TreeType >::HandlePointDeletion ( TreeType *  ,
const size_t   
)
inline

Some tree types require to save some properties at the deletion process.

This method allows the auxiliary information the option of manipulating the tree in order to perform the deletion process. If the auxiliary information does that, then the method should return true; if the method returns false the RectangleTree performs its default behavior.

Parameters
nodeThe node from which the point is being deleted.
localIndexThe local index of the point being deleted.

Definition at line 129 of file x_tree_auxiliary_information.hpp.

template<typename TreeType >
bool mlpack::tree::XTreeAuxiliaryInformation< TreeType >::HandlePointInsertion ( TreeType *  ,
const size_t   
)
inline

Some tree types require to save some properties at the insertion process.

This method allows the auxiliary information the option of manipulating the tree in order to perform the insertion process. If the auxiliary information does that, then the method should return true; if the method returns false the RectangleTree performs its default behavior.

Parameters
nodeThe node in which the point is being inserted.
pointThe global number of the point being inserted.

Definition at line 96 of file x_tree_auxiliary_information.hpp.

template<typename TreeType >
size_t mlpack::tree::XTreeAuxiliaryInformation< TreeType >::NormalNodeMaxNumChildren ( ) const
inline
template<typename TreeType >
size_t& mlpack::tree::XTreeAuxiliaryInformation< TreeType >::NormalNodeMaxNumChildren ( )
inline

Modify the maximum number of a normal node's children.

Definition at line 217 of file x_tree_auxiliary_information.hpp.

References mlpack::tree::XTreeAuxiliaryInformation< TreeType >::normalNodeMaxNumChildren.

template<typename TreeType >
void mlpack::tree::XTreeAuxiliaryInformation< TreeType >::NullifyData ( )
inline

Nullify the auxiliary information in order to prevent an invalid free.

Definition at line 162 of file x_tree_auxiliary_information.hpp.

template<typename TreeType >
XTreeAuxiliaryInformation& mlpack::tree::XTreeAuxiliaryInformation< TreeType >::operator= ( const XTreeAuxiliaryInformation< TreeType > &  other)
inline
template<typename TreeType >
template<typename Archive >
void mlpack::tree::XTreeAuxiliaryInformation< TreeType >::Serialize ( Archive &  ar,
const unsigned  int 
)
inline

Serialize the information.

Definition at line 227 of file x_tree_auxiliary_information.hpp.

References mlpack::data::CreateNVP().

template<typename TreeType >
const SplitHistoryStruct& mlpack::tree::XTreeAuxiliaryInformation< TreeType >::SplitHistory ( ) const
inline

Return the split history of the node associated with this object.

Definition at line 219 of file x_tree_auxiliary_information.hpp.

References mlpack::tree::XTreeAuxiliaryInformation< TreeType >::splitHistory.

Referenced by mlpack::tree::XTreeAuxiliaryInformation< TreeType >::operator=().

template<typename TreeType >
SplitHistoryStruct& mlpack::tree::XTreeAuxiliaryInformation< TreeType >::SplitHistory ( )
inline

Modify the split history of the node associated with this object.

Definition at line 221 of file x_tree_auxiliary_information.hpp.

References mlpack::tree::XTreeAuxiliaryInformation< TreeType >::splitHistory.

template<typename TreeType >
bool mlpack::tree::XTreeAuxiliaryInformation< TreeType >::UpdateAuxiliaryInfo ( TreeType *  )
inline

Some tree types require to propagate the information upward.

This method should return false if this is not the case. If true is returned, the update will be propagated upward.

Parameters
nodeThe node in which the auxiliary information being update.

Definition at line 154 of file x_tree_auxiliary_information.hpp.

Member Data Documentation

template<typename TreeType >
size_t mlpack::tree::XTreeAuxiliaryInformation< TreeType >::normalNodeMaxNumChildren
private
template<typename TreeType >
SplitHistoryStruct mlpack::tree::XTreeAuxiliaryInformation< TreeType >::splitHistory
private

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