mlpack::tree::CosineTree Class Reference

Collaboration diagram for mlpack::tree::CosineTree:
Collaboration graph
[legend]

List of all members.

Public Member Functions

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

Private Attributes

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

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:
data Dataset to create tree from.
centroid Centroid of the matrix.
probabilities Sampling 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

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

Sets the centroid.

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

Returns a reference to 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:
child Index of child to return.
void mlpack::tree::CosineTree::Data ( arma::mat &  d  ) 

Sets a reference to the data.

arma::mat mlpack::tree::CosineTree::Data (  ) 

Returns a reference to the data.

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

Sets the Left child of this node.

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

Gets 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).

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

Sets a reference to Sample Probabilites.

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

Returns a reference to Sample Probabilites.

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

Sets the Right child of this node.

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

Gets 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.

The left child node.

Definition at line 41 of file cosine_tree.hpp.

Number of points in the node.

Definition at line 45 of file cosine_tree.hpp.

Sampling Probabilities.

Definition at line 39 of file cosine_tree.hpp.

The right child node.

Definition at line 43 of file cosine_tree.hpp.


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

Generated on 29 Sep 2016 for MLPACK by  doxygen 1.6.1