<br><br><div class="gmail_quote">On Tue, Jul 27, 2010 at 07:13, 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">Tomek Sowiński wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Andrei Alexandrescu wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
median -> r[r.length / 2]<br>
</blockquote>
<br>
Generalize to quantile.<br>
<a href="http://en.wikipedia.org/wiki/Quantile" target="_blank">http://en.wikipedia.org/wiki/Quantile</a><br>
</blockquote>
<br></div></div>
Makes sense.<br><font color="#888888">
<br>
Andrei<br>
</font></blockquote></div><br><br>Ah, not as methods, but free functions taking sorted ranges:<br><br><br>* fast merge (on n ranges in one go),<br>* fast intersection, union, difference, symmetricDifference. But I see these already exist in std.algo for sets.<br>
* Also, maybe, some kind of takeUpTo(range, Max), that takes all values up to a certain value Max. As it's ordered, we know there is no more value less than Max. I don't if there is a mathematical name for that.<br>
<br>It's just a specialized takeWhile!((ElementType!R v) { return v<Max;})(range);<br><br>btw, takeWhile is a _very_ useful function to add to std.algorithm.<br><br><br><br>Philippe<br>