This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Re: Implement Nakagami distribution as an extension.


 
 
 
On 09/17/12, Ulrich Drepper<drepper@gmail.com> wrote:
 
On Mon, Sep 17, 2012 at 11:17 AM, Ed Smith-Rowland <3dw4rd@verizon.net> wrote:
> Here is a Nakagami continuous distribution.

> Just a nit: the operator() implementations are not consistent. In the
> case without param_type parameter you have a local variable, in the
> case with explicit parameter you don't. I had to look twice to see
> there is no real difference.
I'll fix this
> One question I've been asking myself also for some other
> distributions. Storing the mu and omega values in the object locally
> is not really necessary. They can be computed from the gamma
> distribution parameters. We don't need a local param_type member.
> This has an even bigger effect on the in/out functions. All that
> would be needed is to print/read the _M_gd member.
I'll look into this.
> It's likely not a big thing but perhaps this can open over other
> venues. Would it be useful to have, perhaps, the
> nakagami_distribution type being derived from gamma_distribution?...

Many distributions are derived from simpler ones either as products, quotients, by composition, or more complex functions.  I tried to figure out a scheme - maybe a template that would take a pack of distributions and apply a function.  It seemed more difficult than just writing distributions.  I got bogged down.  On the other hand, if such a tool could be built it would increase the flexibility of the library.  There are many many distributions out there.  I don't mind having a few strange distributions in ext but for an extension to std it might be nice to prosecute this idea of extension tools for distributions (sort of like the engine adaptors, say).  Besides, with template aliasing you could build up some distribution and then call it whatever you like.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]