<div dir="ltr">It is great to use compile-time settings, IF they will improve the performance.&nbsp; But in this case I don&#39;t think there will be any speed lost by moving the dimensionality into the runtime-world.<br><br><div class="gmail_quote">
2008/9/30 Prabhanjan Kambadur <span dir="ltr">&lt;<a href="mailto:pkambadu@indiana.edu">pkambadu@indiana.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;">
<div dir="ltr">Dear Sylvain and Paul,<br><br>Thank you for the interest. Just to clarify, I did not envision a KDTree that would change dimensionality on the fly. The use case would be more like:<br><br>KDTree&lt;MyCoordinateType&gt; my_tree;<br>

my_tree.set_dimension(3);<br>// use the tree<br>my_tree.wipe();<br>my_tree.set_dimension(5);<br>// use it again.<br><br>Here, MyCoordinateType can be dynamically reconfigured. Of course, the method names could be more fitting :-). The reason I mention this is because we use the KDTree as a primary data structure in the library. We support reconfiguring our library through a similar mechanism. Being a staunch supporter of the generic programming paradigm, I am all for compile-time polymorphism. At the same time, I have been convinced by the scientists we work with at the IBM T J Watson Research Center that the dimensionality really is a feature of the data set, and as such, should be a runtime parameter (in this particular case at least). <br>

<br>Actually, one could support setting the dimension both at compile-time and at run-time. For example, one can imagine partial specialization of the KDTree for a particular sentinel value of dimension.<br><br>For example:<br>

<br><i><b>enum</b> {KDTree_reconfigurable=0xDEADBEEF};<br><br><b>template</b> &lt;<b>typename</b> __Val, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>typename</b> _Acc, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>typename</b> _Cmp<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>typename</b> _Alloc&gt;<br>

<b>struct</b> KDTree&lt;KDTree_reconfigurable,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; __Val,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _Acc,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _Cmp<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _Alloc&gt; KDTree : <b>public</b> ... {<br>
<br>
};<br></i><br>Please let me know if you have any questions regarding the use of the suggested features.<br><br>Thanks,<br><br>Anju<br>
</div>
</blockquote></div><br></div>