<div class="gmail_quote"><br>On Sun, May 30, 2010 at 18:00, Andrei Alexandrescu <span dir="ltr"><<a href="mailto:SeeWebsiteForEmail@erdani.org">SeeWebsiteForEmail@erdani.org</a>></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² > 3 }<br>
=><br>
( list!"2*a" | iota(1,int.max) * where!"x^^2 > 3" )<br>
return comp ! ("tuple(a,b,c)", "a*a+b*b==c*c && a<b")<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'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 'topology' : 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>
-><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't forget - the gates of Phobos are open.<br><font color="#888888">
<br>
Andrei<br>
<br></font></blockquote><div><br>Concerning helping Phobos, I'd be delighted to if the Phobos team deems
it possible. It's just that my job and formation are far from coding
(I'm more a physicist), so I'm not sure my code would be up to it without being reviewed.<br><br>I'm OK with pretty much everything concerning licensing and adaptation. I'll begin by putting a Boost licence in my code, when dsource is up again. If someone is interested by some of it, I'm quite ready to adapt it to conform to D/Phobos evolutions. That's what I'm doing anyway.<br>
<br><br> Philippe<br><br></div></div>