<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
Others have suggested this in the past. There are/were a few major
things holding it up:<br>
<br>
1. While I feel that dstats.summary has about the right level of
complexity/engineering for a third-party statistics lib, I'm a
little worried that it's overengineered for a standard library
module.<br>
<br>
2. The brokenness of alias this. I designed the hierarchy of
different summary-calculating output ranges to rely heavily on alias
this. The relevant bugs may have been fixed recently, in 2.050.
I'll have to check.<br>
<br>
3. A bunch of stuff uses TempAlloc for its temporary scratch
space. I'd like to keep it that way for efficiency, but it's hard
to put TempAlloc into Phobos given that the issue of GC scanning <b>still</b>
isn't solved.<br>
<br>
One solution to these problems is to just move the more basic stuff
over to Phobos and publicly import it from dstats.summary. <br>
<br>
On 11/18/2010 8:00 AM, SHOO wrote:
<blockquote cite="mid:4CE52367.1020701@nifty.com" type="cite">BTW, I
want statistical functions in Phobos. For example, dstats.summary
looks good. Is there the plan to introduce such functions?
<br>
<br>
--
<br>
SHOO
<br>
<br>
(2010/11/18 6:09), Don Clugston wrote:
<br>
<blockquote type="cite">I have a pile of functions I wrote for
Tango, most of which are part
<br>
of C99. I'd like to move them into Phobos. In the process, I'd
like to
<br>
clean up a few things in std.math.
<br>
<br>
The main idea is that a new module, std.mathspecial, will
contain
<br>
mathematical Special Functions. In the long term, there could be
quite
<br>
a large number of these, but I think it will still be OK to have
all
<br>
of them declared in a single module.
<br>
The implementations of these functions will mostly reside in
<br>
std.internal.math.XXX. In many cases, the implementations are
quite
<br>
large.
<br>
<br>
std.math will be restricted to low-level operations and "high
school"
<br>
mathematics.
<br>
<br>
(1) Add two necessary functions to std.math:
<br>
<br>
// Rounds x to the nearest int or long using the currently
selected
<br>
rounding mode
<br>
// (MUCH faster than cast(int)).
<br>
int rndint(real x)
<br>
long rndlong(real x)
<br>
<br>
(2) Delete etc.gamma
<br>
<br>
(3) Create a new module std.mathspecial.
<br>
<br>
Move the following functions from std.math into std.mathspecial:
<br>
erf()
<br>
erfc()
<br>
lgamma() -----> name changes to logGamma(real x)
<br>
tgamma() ---> name changes to gamma(real x).
<br>
BTW The 't' in the C name exists for extremely silly historical
reasons.
<br>
<br>
std.math will retain alias for these functions, before they are
<br>
eventually deprecated.
<br>
<br>
(4) Add implementations of those functions into
std.internal.math.gammafunction
<br>
Also add:
<br>
real sgnGamma(real x); // the sign of gamma(x), always used
with logGamma.
<br>
real digamma(x); // The digamma function
<br>
real beta(real x, real y); // the beta function
<br>
<br>
I'm not sure about the naming for the other functions. I will
leave
<br>
that for a later discussion.
<br>
They include:
<br>
* Distribution functions for the normal, F, chi-square,
students-T, gamma, beta,
<br>
poisson, binomial, and negative binomial distributions.
<br>
* Cylindrical Bessel functions
<br>
real cylBessel_j0(real x) real cylBessel_y0(real x)
<br>
real cylBessel_j1(real x) real cylBessel_y1(real x)
<br>
real cylBessel_jn(int n, real x ) real cylBessel_yn(int n, real
x)
<br>
</blockquote>
_______________________________________________
<br>
phobos mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:phobos@puremagic.com">phobos@puremagic.com</a>
<br>
<a class="moz-txt-link-freetext" href="http://lists.puremagic.com/mailman/listinfo/phobos">http://lists.puremagic.com/mailman/listinfo/phobos</a>
<br>
<br>
</blockquote>
<br>
</body>
</html>