Boost logo

Ublas :

From: Michael Stevens (mail_at_[hidden])
Date: 2005-06-17 08:35:03


After Karl wrote

> Michael Stevens wrote:
> >I think Ian's suggestion of changing uBLAS default evaluation to be alias
> >unsafe and checking on DEBUG builds is the way to go!
> >
> >Michael
> I agree,

it would be good to try and agree on how we would make such a transition.

First we will need some syntax to tell uBLAS to expect the lvalue to be an
alias of something on the RHS and so to use a temporary. My suggestion would
be to add the 'alias' function thus:
        alias (x) = expression;

This is equivalent to the current 'noalias' which can be dropped once the
transition is complete.

Second we would need to document the expected change of semantics. The
implementation of assignment without a temporary requires the lvalue be size
conformant with the expression. This is different then the present default
assignment via a temporary where we get resizing for free.

Would the change of semantics be a big problem for anyone?


Michael Stevens Systems Engineering
34128 Kassel, Germany
Phone/Fax: +49 561 5218038
Navigation Systems, Estimation  and
                 Bayesian Filtering