<div class="gmail_quote"><br>On Sun, May 30, 2010 at 18:00, Andrei Alexandrescu <span dir="ltr">&lt;<a href="mailto:SeeWebsiteForEmail@erdani.org">SeeWebsiteForEmail@erdani.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div class="h5">On 05/30/2010 10:27 AM, Simen kjaeraas wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
{ 2·x | x ∈ N, x² &gt; 3 }<br>
=&gt;<br>
( list!&quot;2*a&quot; | iota(1,int.max) * where!&quot;x^^2 &gt; 3&quot; )<br>
return comp ! (&quot;tuple(a,b,c)&quot;, &quot;a*a+b*b==c*c &amp;&amp; a&lt;b&quot;)<br></blockquote></div></div></blockquote><div><br><br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div class="h5"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
This reminded me that Phobos lacks a combinatorial range, taking two or<br>
more (forward) ranges and giving all combinations thereof<br></blockquote></div></div></blockquote><div><br>Simen, could you please have a look at my dranges project?<br><br><a href="http://www.dsource.org/projects/dranges/">http://www.dsource.org/projects/dranges/</a><br>
<br>Look at the algorithm and range sections, you&#39;ll find plenty of code that try to tackle this.<br>In particular combinations() in algorithm2, and also tensorialProduct() in rangeofranges<br><br>combinations is a higher-order range that takes any number of forward ranges and output their combinations as tuples.<br>
<br>tensorialProduct does the same, but creates &#39;topology&#39; : the combination of three ranges is a range, whereas the tensorial product of three (linear) ranges is a range of ranges of ranges:<br><br>tensorialProduct([0,1],[2,3])<br>
-&gt;<br>[[(0,2),(0,3)],<br> [(1,2),(1,3)]]<br><br>(where (x,y) indicates a tuple)<br><br><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div class="h5"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"></blockquote></div></div>
Yah, that would be useful. If Philippe agrees to adapt his work, maybe that would be the fastest route. And don&#39;t forget - the gates of Phobos are open.<br><font color="#888888">
<br>
Andrei<br>
<br></font></blockquote><div><br>Concerning helping Phobos, I&#39;d be delighted to if the Phobos team deems 
it possible. It&#39;s just that my job and formation are far from coding 
(I&#39;m more a physicist), so I&#39;m not sure my code would be up to it without being reviewed.<br><br>I&#39;m OK with pretty much everything concerning licensing and adaptation. I&#39;ll begin by putting a Boost licence in my code, when dsource is up again. If someone is interested by some of it, I&#39;m quite ready to adapt it to conform to D/Phobos evolutions. That&#39;s what I&#39;m doing anyway.<br>
<br><br>    Philippe<br><br></div></div>