MLPACK  1.0.8
cosine_tree.hpp
Go to the documentation of this file.
1 
23 #ifndef __MLPACK_CORE_TREE_COSINE_TREE_COSINE_TREE_HPP
24 #define __MLPACK_CORE_TREE_COSINE_TREE_COSINE_TREE_HPP
25 
26 #include <mlpack/core.hpp>
27 
28 namespace mlpack {
29 namespace tree {
30 
32 {
33  private:
35  arma::mat data;
37  arma::rowvec centroid;
39  arma::vec probabilities;
45  size_t numPoints;
46 
47  public:
49  //typedef MatType Mat;
57  CosineTree(arma::mat data, arma::rowvec centroid, arma::vec probabilities);
58 
62  CosineTree();
63 
69  ~CosineTree();
70 
72  CosineTree* Left() const;
73 
75  void Left(CosineTree* child);
76 
78  CosineTree* Right() const;
79 
81  void Right(CosineTree* child);
82 
89  CosineTree& Child(const size_t child) const;
90 
92  size_t NumPoints() const;
93 
95  arma::mat Data();
96 
98  void Data(arma::mat& d);
99 
101  arma::vec Probabilities();
102 
104  void Probabilities(arma::vec& prob);
105 
107  arma::rowvec Centroid();
108 
110  void Centroid(arma::rowvec& centr);
111 
112 };
113 
114 }; // namespace tree
115 }; // namespace mlpack
116 
117 // Include implementation.
118 #include "cosine_tree_impl.hpp"
119 
120 #endif
arma::mat data
Data.
Definition: cosine_tree.hpp:35
CosineTree * left
The left child node.
Definition: cosine_tree.hpp:41
CosineTree * Right() const
Gets the right child of this node.
size_t NumPoints() const
Return the number of points in this node (0 if not a leaf).
arma::mat Data()
Returns a reference to the data.
~CosineTree()
Deletes this node, deallocating the memory for the children and calling their destructors in turn...
CosineTree * Left() const
Gets the left child of this node.
arma::vec probabilities
Sampling Probabilities.
Definition: cosine_tree.hpp:39
CosineTree * right
The right child node.
Definition: cosine_tree.hpp:43
arma::rowvec centroid
Centroid.
Definition: cosine_tree.hpp:37
size_t numPoints
Number of points in the node.
Definition: cosine_tree.hpp:45
CosineTree & Child(const size_t child) const
Return the specified child (0 will be left, 1 will be right).
arma::vec Probabilities()
Returns a reference to Sample Probabilites.
CosineTree()
Create an empty tree node.
arma::rowvec Centroid()
Returns a reference to the centroid.