MLPACK  1.0.8
Public Member Functions | Private Attributes | List of all members
mlpack::tree::CosineTree Class Reference
Collaboration diagram for mlpack::tree::CosineTree:
Collaboration graph
[legend]

Public Member Functions

 CosineTree (arma::mat data, arma::rowvec centroid, arma::vec probabilities)
 So other classes can use TreeType::Mat. More...
 
 CosineTree ()
 Create an empty tree node. More...
 
 ~CosineTree ()
 Deletes this node, deallocating the memory for the children and calling their destructors in turn. More...
 
arma::rowvec Centroid ()
 Returns a reference to the centroid. More...
 
void Centroid (arma::rowvec &centr)
 Sets the centroid. More...
 
CosineTreeChild (const size_t child) const
 Return the specified child (0 will be left, 1 will be right). More...
 
arma::mat Data ()
 Returns a reference to the data. More...
 
void Data (arma::mat &d)
 Sets a reference to the data. More...
 
CosineTreeLeft () const
 Gets the left child of this node. More...
 
void Left (CosineTree *child)
 Sets the Left child of this node. More...
 
size_t NumPoints () const
 Return the number of points in this node (0 if not a leaf). More...
 
arma::vec Probabilities ()
 Returns a reference to Sample Probabilites. More...
 
void Probabilities (arma::vec &prob)
 Sets a reference to Sample Probabilites. More...
 
CosineTreeRight () const
 Gets the right child of this node. More...
 
void Right (CosineTree *child)
 Sets the Right child of this node. More...
 

Private Attributes

arma::rowvec centroid
 Centroid. More...
 
arma::mat data
 Data. More...
 
CosineTreeleft
 The left child node. More...
 
size_t numPoints
 Number of points in the node. More...
 
arma::vec probabilities
 Sampling Probabilities. More...
 
CosineTreeright
 The right child node. More...
 

Detailed Description

Definition at line 31 of file cosine_tree.hpp.

Constructor & Destructor Documentation

mlpack::tree::CosineTree::CosineTree ( arma::mat  data,
arma::rowvec  centroid,
arma::vec  probabilities 
)

So other classes can use TreeType::Mat.

Constructor

Parameters
dataDataset to create tree from.
centroidCentroid of the matrix.
probabilitiesSampling probabilities
mlpack::tree::CosineTree::CosineTree ( )

Create an empty tree node.

mlpack::tree::CosineTree::~CosineTree ( )

Deletes this node, deallocating the memory for the children and calling their destructors in turn.

This will invalidate any pointers or references to any nodes which are children of this one.

Member Function Documentation

arma::rowvec mlpack::tree::CosineTree::Centroid ( )

Returns a reference to the centroid.

void mlpack::tree::CosineTree::Centroid ( arma::rowvec &  centr)

Sets the centroid.

CosineTree& mlpack::tree::CosineTree::Child ( const size_t  child) const

Return the specified child (0 will be left, 1 will be right).

If the index is greater than 1, this will return the right child.

Parameters
childIndex of child to return.
arma::mat mlpack::tree::CosineTree::Data ( )

Returns a reference to the data.

void mlpack::tree::CosineTree::Data ( arma::mat &  d)

Sets a reference to the data.

CosineTree* mlpack::tree::CosineTree::Left ( ) const

Gets the left child of this node.

void mlpack::tree::CosineTree::Left ( CosineTree child)

Sets the Left child of this node.

size_t mlpack::tree::CosineTree::NumPoints ( ) const

Return the number of points in this node (0 if not a leaf).

arma::vec mlpack::tree::CosineTree::Probabilities ( )

Returns a reference to Sample Probabilites.

void mlpack::tree::CosineTree::Probabilities ( arma::vec &  prob)

Sets a reference to Sample Probabilites.

CosineTree* mlpack::tree::CosineTree::Right ( ) const

Gets the right child of this node.

void mlpack::tree::CosineTree::Right ( CosineTree child)

Sets the Right child of this node.

Member Data Documentation

arma::rowvec mlpack::tree::CosineTree::centroid
private

Centroid.

Definition at line 37 of file cosine_tree.hpp.

arma::mat mlpack::tree::CosineTree::data
private

Data.

Definition at line 35 of file cosine_tree.hpp.

CosineTree* mlpack::tree::CosineTree::left
private

The left child node.

Definition at line 41 of file cosine_tree.hpp.

size_t mlpack::tree::CosineTree::numPoints
private

Number of points in the node.

Definition at line 45 of file cosine_tree.hpp.

arma::vec mlpack::tree::CosineTree::probabilities
private

Sampling Probabilities.

Definition at line 39 of file cosine_tree.hpp.

CosineTree* mlpack::tree::CosineTree::right
private

The right child node.

Definition at line 43 of file cosine_tree.hpp.


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