Re: [eigen] first time usage by me! and very satisfied!

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Hi Gael,
   I just like jumping in and adding my two cents:

> 
> indeed I though it would not harm to add shortcuts for most
> common
> statistic reduction methods. they would be added in the
> Array module,
> and also be available in a column and row wise flavors.

You might want to consider adding another module (Statistics) instead of adding it to core Array. There's lots of these kinds of algos which can be added but not necessarily useful for non-statistians.

I don't know if would be better to extend Array via composition or inheritance in this case. It would be possible to accelerate the algos by using caching in the derived class. Maybe make caching a trait...

> 
> /* use the precomputed mean to compute the stddev */
> Scalar stddev(const Scalar& mean) const;
> /* shortcut */
> Scalar stddev() const { return stddev(mean()); }

use caching instead of the first method

> 
> maybe we can even have a single version with a default arg
> value:
> Scalar stddev(const Scalar& _mean = mean()) const;
> but I don't know if it's legal to call a non static
> member function on *this...

This is definitely not legal. Default arguments have to be set at compile time. 

> I prefer that to something like:
> Scalar stddev(Scalar*  returnedMean = 0) const;
> because in case you have already computed the mean value
> you cannot
> tell stddev to use it...

This is confusing. what does the function return if returnedMean == 0?
It might be better to cache the mean and not return it in the stddev() method. The user has access to it in mean(), no?

> 
> so to summarize we would add:
> 
> * mean()
> 
> * standardDeviation([precomputed_mean])
> yeah, eventually "standardDeviation" is not too
> long
> 
> * variance([precomputed_mean])
> 
> * median()
> maybe here we could have an optional argument to tell if
> the vector is
> already sorted ??

We could have a cached sorted flag...

> 
> * sort()
> median needs a sort algo, and here I really mean
> "sort", not "sorted",
> so it an in-place sort
> 


Cheers
Ben


> 
> cheers,
> gael.
> 
> On Thu, Sep 11, 2008 at 8:29 PM, Andre Krause
> <post@xxxxxxxxxxxxxxxx> wrote:
> > dear list, just wanted to let you all know i am using
> eigen2 alpha 07 for the
> > first time - and i am very satisfied. works like
> charm, with no problems on
> > win32 and visualc++ 2008.
> >
> > though i am missing some basic convenience functions
> like mean, medium, stdev
> > etc. . i already heard on #eigen, that they are
> planned for some future release.
> >
> > kind regards,
> >        andre
> >
> >
> >



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/