Subject: Re: [ublas] fixed size vector in boost::numeric::ublas?
From: Nasos Iliopoulos (nasos_i_at_[hidden])
Date: 2010-07-23 15:43:26
thanx for the insight!
In such a case I suppose we can go by changing the vector concept by removing the resize(), and extend it by a dynamic_vector concept that includes the resize, I think in that way nothing breaks (of course the containers that refine it and all the algorithms need to also follow). The magnitude of the changes should be manageable.
Furthermore AFAIK there is no hard-concept checking into uBlas, so making the changes into the main code should be straightforward.
> From: vakopian_at_[hidden]
> Date: Fri, 23 Jul 2010 12:00:09 -0700
> To: ublas_at_[hidden]
> Subject: Re: [ublas] fixed size vector in boost::numeric::ublas?
> On Fri, Jul 23, 2010 at 5:23 AM, Nasos Iliopoulos <nasos_i_at_[hidden]> wrote:
> > If I remember well from my implelentation the major decision that has to be made relates to the resize(..) member function. Since the fixed types cannot resize it would seem obvious that those functions should not be implemented at all, but I think uBlas is using it in some algorithms, so either the algorithms need to be specialized, or the the fixed type resize function needs to be implements as an empty function. I think the first option is the best.
> The idea of a fixed size vector has been discussed multiple times on
> this list over the years. Typically it has been rejected because the
> Vector Concept (as per
> ), defines the resize() method. Moreover it has a post condition
> v.size () == n. So not having an implementation would break the
> concept, having an empty implementation would break the concept's post
> condition. A third option is to throw an exception (saying that it
> cannot be resized). I'm not sure if throwing an exception technically
> breaks the concept. If it does not, then we're fine. Otherwise, we
> should either consider changing the concept, or agree that
> fixed_vector does not implement the Vector concept (in which case
> naming it a "..._vector" is somewhat misleading).
> ublas mailing list
> Sent to: nasos_i_at_[hidden]
Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox.