sorry don&#39;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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; count_within_range(const_reference __V, subvalue_type const __R) const<br>
<br>instead, use<br>&nbsp;size_type<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; count_within_range(_Region_ const&amp; __REGION) const<br><br>which basically means you make your own Region and then call the count method.<br><br>eg (I&#39;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.&nbsp; in the above, &#39;0&#39; 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">&lt;<a href="mailto:hhong@cs.kent.edu">hhong@cs.kent.edu</a>&gt;</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>
&nbsp;I&#39;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>
&nbsp;Line 76:<br>
// &nbsp;unsigned int const RANGE =3;<br>
&nbsp;std::vector&lt;int&gt; RANGE;<br>
&nbsp;RANGE.push_back(3);<br>
&nbsp;RANGE.push_back(3);<br>
&nbsp;RANGE.push_back(3);<br>
<br>
Line 78: &nbsp;size_t count = t.count_within_range(s, RANGE);<br>
***************************************<br>
<br>
&nbsp;In order to achieve that, I modify your variable R in the file &quot;region.hpp&quot; to R[__i], for example:<br>
***************************************<br>
in region.hpp<br>
***************************************<br>
Line 23: typedef std::vector&lt;_SubVal&gt; subvalue_type1;<br>
Line 41: subvalue_type1 const&amp; __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>
&nbsp;But it doesn&#39;t work.<br>
&nbsp;Could you guys with gift help me out?<br>
&nbsp;Thank you &nbsp;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>