Boost logo

Ublas :

Subject: Re: [ublas] fixed size vector in boost::numeric::ublas?
From: Markus Grabner (grabner_at_[hidden])
Date: 2010-08-02 13:55:05


Marco Guazzone wrote:

> On Fri, Jul 23, 2010 at 10:03 AM, Andrea Cassioli
> <cassioliandre_at_[hidden]> wrote:
>> Hi guys,
>> I've played a little bit with the fixed_size array (which was missing
>> as far as I know in uBlas) and seems to be a very promising idea!
>> Looking around to address the issues you rise about the fixed_array
>> ctor, array items initialization does not seem an easy to solve
>> problem.
>> Some people propose to use #define expansion to recursively generate a
>> list of the type
>>
>> array_type v[N]={value,value..}
>>
>> But personally I do not think it is a crucial issues at the present time.
>>
>> Good job guys!
>
> Hi,
>
> Does the ublas::c_vector class already implement this kind of vectors?
>
> As you can see from its definition:
>
> template<class T, std::size_t N>
> class c_vector;
>
> You bind the size at compile time, and indeed the internal container
> can be implemented as a static (i.e. on the stack) array.
The "c_vector" template also has a "size_" member, so it won't do the trick
of simply mapping a contiguous array of values (e.g., point coordinates in
3D space) to an array of "c_vector"s.

        Kind regards,
                Markus

-- 
Markus Grabner
Institute for Computer Graphics and Vision
Graz University of Technology, Inffeldgasse 16a/II, 8010 Graz, Austria
WWW: http://www.icg.tugraz.at/Members/grabner