Lines Matching refs:last

84   int dimension_of_highest_variance(__instype * first, __instype * last,  in dimension_of_highest_variance()  argument
86 assert(last - first > 0); in dimension_of_highest_variance()
92 for (__instype * k = first; k < last; ++k) in dimension_of_highest_variance()
94 mean /= last - first; in dimension_of_highest_variance()
96 for (__instype * k = first; k < last; ++k) { in dimension_of_highest_variance()
100 var /= last - first; in dimension_of_highest_variance()
117 __instype * median_partition(__instype * first, __instype * last, in median_partition() argument
119 assert(last - first > 0); in median_partition()
120 __instype *k = first + (last - first) / 2; in median_partition()
121 median_partition(first, last, k, dim, ctor); in median_partition()
140 void median_partition(__instype * first, __instype * last, in median_partition() argument
142 int pivot = (last - first) / 2; in median_partition()
144 std::swap(first[pivot], last[-1]); in median_partition()
145 __instype *middle = std::partition(first, last - 1, in median_partition()
147 (last[-1], dim, deref, ctor)); in median_partition()
148 std::swap(*middle, last[-1]); in median_partition()
151 median_partition(middle + 1, last, k, dim, ctor); in median_partition()
158 int insert(__instype * first, __instype * last, __valuector ctor) { in insert() argument
159 if (first == last) in insert()
163 int dim = dimension_of_highest_variance(first, last, ctor); in insert()
164 __instype *median = median_partition(first, last, dim, ctor); in insert()
167 for (; split != last && deref(ctor(*split), dim) == in insert()
170 if (split == last) { // leaf in insert()
193 int right = insert(split, last, ctor); in insert()
241 CvKDTree(__valuetype * first, __valuetype * last, int _point_dim, in CvKDTree() argument
244 set_data(first, last, _point_dim, identity_ctor()); in CvKDTree()
248 CvKDTree(__instype * first, __instype * last, int _point_dim, in CvKDTree() argument
251 set_data(first, last, _point_dim, ctor); in CvKDTree()
258 void set_data(__valuetype * first, __valuetype * last, int _point_dim) { in set_data() argument
259 set_data(first, last, _point_dim, identity_ctor()); in set_data()
262 void set_data(__instype * first, __instype * last, int _point_dim, in set_data() argument
266 nodes.reserve(last - first); in set_data()
267 root_node = insert(first, last, ctor); in set_data()