Boost logo

Ublas :

From: Michael Stevens (m-stevens_at_[hidden])
Date: 2005-01-02 15:44:48


On Thursday 30 December 2004 20:44, Eric Lindahl wrote:
> Maintaining a useless size member for a fixed size vector is not
> acceptable.
Agreed, small fixed size vector are not special cased by uBLAS, but it is
acceptable!

> In Blitz++, I commonly construct an Array over a float array that only
> contains
> floats. My memory footprint should be exactly the same whether I'm using
> uBlas
> Blitz++ or hand-coded C. Why not a version that uses an enum?
>
> public:
> enum { SIZE = size_ };
> private:
> BOOST_UBLAS_BOUNDED_ARRAY_ALIGN value_type data_ [SIZE];
>
> instead of:
>
> private:
> size_type size_;
> BOOST_UBLAS_BOUNDED_ARRAY_ALIGN value_type data_ [N];

I think a vector storage type like this could be provided. So that the
majority of uBLAS expressions work it would still have to have the standard
vector interface. In particular a size function. The amount to be gain by
this would of course strongly depend on the compiler. I would love to see
some code and benchmarks to see what would be a good way to proceed. For me
accelerating 2 and 3 vectors and Quaterions would be quite useful.

Michael

-- 
___________________________________
Michael Stevens Systems Engineering
34128 Kassel, Germany
Phone/Fax: +49 561 5218038
Navigation Systems, Estimation  and
                 Bayesian Filtering
    http://bayesclasses.sf.net
___________________________________