38 #ifndef PCL_ML_DT_DECISION_FOREST_H_ 39 #define PCL_ML_DT_DECISION_FOREST_H_ 41 #include <pcl/common/common.h> 43 #include <pcl/ml/dt/decision_tree.h> 52 template <
class NodeType>
54 :
public std::vector<pcl::DecisionTree<NodeType> >
83 const int num_of_trees =
static_cast<int> (this->size ());
84 stream.write (reinterpret_cast<const char*> (&num_of_trees),
sizeof (num_of_trees));
86 for (
size_t tree_index = 0; tree_index < this->size (); ++tree_index)
88 (*this) [tree_index].serialize (stream);
107 stream.read (reinterpret_cast<char*> (&num_of_trees),
sizeof (num_of_trees));
108 this->resize (num_of_trees);
110 for (
size_t tree_index = 0; tree_index < this->size (); ++tree_index)
112 (*this) [tree_index].deserialize (stream);
Class representing a decision forest.
void serialize(::std::ostream &stream) const
brief Returns the number of trees in the forest.
void deserialize(::std::istream &stream)
Deserializes the decision tree.
DecisionForest()
Constructor.
virtual ~DecisionForest()
Destructor.