Boost logo

Ublas :

From: Michael Stevens (mail_at_[hidden])
Date: 2005-03-14 07:29:55


Hi Toon,

On Thursday 10 March 2005 13:13, Toon Knapen wrote:
> In the constructor of matrix_range for instance, the precondition checks
> are commented out. Now there is no error generated when you create a
> matrix_range that is bigger than the matrix is defined on. Anybody an
> idea why these precondition checks are commented out?

The early precondition checks can now be removed. The commenting out with
            // Early checking of preconditions here.
were part of the process to deprecate them.

They were introduced originally as many of the proxies did not have very good
checking for invalid element accesses. The early checks made things more
complete. They also had the advantage that they gave the user a simple
runtime error.
The disadvantage of early checks are major:
a) Proxies do not own the underling matrix/vector. It could change size making
a nonsense of any early precondition check.
b) You can nest proxies. The final proxy may have all valid elements "(well
formed" vector expression) even if intermidiate proxies do not.
c) Being able to create "not well formed" proxies but only access valid
elements can be useful.

I think at this stage the comments and code could be completely removed. The
documentation correctly describes the current behaviour.

Michael

-- 
___________________________________
Michael Stevens Systems Engineering
Navigation Systems, Estimation  and
                 Bayesian Filtering
    http://bayesclasses.sf.net
___________________________________