sorry don't have much time to go into it fully, but you are trying to use <br><br>t.count_within_range(p,range)<br>which is defined as:<br>size_type<br> count_within_range(const_reference __V, subvalue_type const __R) const<br>
<br>instead, use<br> size_type<br> count_within_range(_Region_ const& __REGION) const<br><br>which basically means you make your own Region and then call the count method.<br><br>eg (I've forgotten how to do this with less fuss, but maybe someone else knows)<br>
<br>tree_type::Region region( p, 0, tree.value_acc(), tree.value_comp() );<br>// 0: initial range is zero<br><br>// set up the box<br>region.set_low_bound( 54, 0 );<br>region.set_high_bound( 56, 0 );<br>// repeat for each dimension. in the above, '0' is the first dimension.<br>
<br>// do the count<br>num = tree.count_within_range(region);<br><br>so this will look within the box defined by region...<br><br>hows that?<br><br><br><div class="gmail_quote">2008/11/16 Alex Hong <span dir="ltr"><<a href="mailto:hhong@cs.kent.edu">hhong@cs.kent.edu</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hello, guys<br>
I'm working on your kdtree-source, and I want to modify your test to accept different range restrictives on each dimensional, as this:<br>
***************************************<br>
in test_kdtree.hpp<br>
***************************************<br>
Line 76:<br>
// unsigned int const RANGE =3;<br>
std::vector<int> RANGE;<br>
RANGE.push_back(3);<br>
RANGE.push_back(3);<br>
RANGE.push_back(3);<br>
<br>
Line 78: size_t count = t.count_within_range(s, RANGE);<br>
***************************************<br>
<br>
In order to achieve that, I modify your variable R in the file "region.hpp" to R[__i], for example:<br>
***************************************<br>
in region.hpp<br>
***************************************<br>
Line 23: typedef std::vector<_SubVal> subvalue_type1;<br>
Line 41: subvalue_type1 const& __R<br>
Line 45: _M_low_bounds[__i] = _M_acc(__V,__i) - __R[__i];<br>
Line 46: _M_high_bounds[__i] = _M_acc(__V,__i) + __R[__i];<br>
***************************************<br>
But it doesn't work.<br>
Could you guys with gift help me out?<br>
Thank you very much.<br><font color="#888888">
<br>
-- <br>
<br>
Regards,<br>
Hui Hong(Alex)<br>
875B Allerton Street, Kent, OH, 44240<br>
Cell: 562-373-8939<br>
Work: 330-672-9107<br>
Home: 330-238-4168<br>
<br>
</font></blockquote></div><br>