35 #ifndef VIGRA_RANDOM_FOREST_REGION_HXX
36 #define VIGRA_RANDOM_FOREST_REGION_HXX
40 #include "vigra/mathutil.hxx"
41 #include "vigra/array_vector.hxx"
42 #include "vigra/sized_int.hxx"
43 #include "vigra/matrix.hxx"
44 #include "vigra/random.hxx"
45 #include "vigra/functorexpression.hxx"
60 typedef Iter IndexIterator;
64 DecisionTreeNoParent = -1
79 bool classCountsIsValid;
80 bool weightedClassCountsIsValid;
81 IndexIterator begin_, end_;
83 IndexIterator oob_begin_, oob_end_;
91 void setRange(IndexIterator s, IndexIterator e)
97 void set_oob_range(IndexIterator s, IndexIterator e)
106 begin_ = end_ = IndexIterator();
107 oob_begin_ = oob_end_ = IndexIterator();
108 size_ = oob_size_ = 0;
110 rightParent = DecisionTreeNoParent;
111 classCountsIsValid =
false;
118 for(
int ii = 0; ii < static_cast<int>(classCounts().
size()); ++ii)
120 num += classCounts()[ii] > 0;
125 int& operator[](
int i)
130 IndexIterator & begin()
135 IndexIterator & end()
139 IndexIterator & oob_begin()
144 IndexIterator & oob_end()
148 ArrayVector<double> & classCounts()
152 ArrayVector<double> & weightedClassCounts()
156 bool classCountsValid(
bool u)
158 classCountsIsValid = u;
159 return classCountsIsValid;
163 void classCounts(ArrayVector<Int32> in);
165 DT_StackEntry( IndexIterator i, IndexIterator e,
167 Int32 lp = DecisionTreeNoParent,
168 Int32 rp = DecisionTreeNoParent)
172 classCounts_(classCount, 0u),
173 classCountsIsValid(false),
186 Int32 oob_size()
const
197 #endif // VIGRA_RANDOM_FOREST_REGION_HXX
Definition: rf_region.hxx:57
Int32 leftParent
Definition: rf_region.hxx:69
Definition: array_vector.hxx:58
detail::SelectIntegerType< 32, detail::SignedIntTypes >::type Int32
32-bit signed int
Definition: sized_int.hxx:175
size_type size() const
Definition: array_vector.hxx:358
ArrayVector< std::pair< Int32, double > > rule
Definition: rf_region.hxx:73