|
Ublas : |
Subject: Re: [ublas] fixed size vector in boost::numeric::ublas?
From: David Bellot (david.bellot_at_[hidden])
Date: 2010-07-23 09:40:47
It seems we're having many implementations of fixed size vector.
Thanks guys.
Let the race begins.... ;-)
On Fri, Jul 23, 2010 at 14:51, Marco Guazzone <marco.guazzone_at_[hidden]>wrote:
> On Fri, Jul 23, 2010 at 2:43 PM, Nasos Iliopoulos <nasos_i_at_[hidden]>
> wrote:
> > Marko,
> >
> > The c_vector indeed works on the stack, but it still has a redundant size
> > member function, that when used small fixed containers (i.e. 2 element
> > vectors), causes some serious memory overhead.
> >
> > Furthermore getting rid of the size member variable opens a nice
> opportunity
> > to cast items from and to a fixed_vector (or matrix) for a variety of
> nice
> > interfacing tricks.
> >
> > For example consider the following:
> >
> > std::vector<ublas::fixed_vector<float,3> > vertices;
> >
> > the following statement:
> >
> > static_cast<float *>(&vertices[0])
> >
> > will return a pointer that can go directly to say OpenGL to create a
> vertex
> > buffer, while at the same time retain all the uBlas stuff to operate on
> your
> > vertices! (as long as you don't want to go the shader way and you can
> afford
> > to update the vertices every frame - a common scenario when you morph
> them).
> >
>
> Hi Nasos,
>
> Uhh I did't get this point.
> That's very interesting!!!
>
> Thank you very much for the explanation.
>
> Cheers,
>
> -- Marco
> _______________________________________________
> ublas mailing list
> ublas_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/ublas
> Sent to: david.bellot_at_[hidden]
>
-- David Bellot, PhD david.bellot_at_[hidden] http://david.bellot.free.fr