Boost logo

Ublas :

From: Thomas Lemaire (thomas.lemaire_at_[hidden])
Date: 2006-05-15 08:18:35

Dear list,

Here is a sample code:

void test() {
      ublas::matrix<double> M(4,4);
      ublas::matrix_vector_range<ublas::matrix<double> > t(M,
ublas::range(0,3), ublas::range(3,4));
      std::cout << t;

which I compile _whithout_ -DNDEBUG, execution gives:

Assertion failed in file /usr/include/boost/numeric/ublas/matrix_proxy.hpp at
line 970:
size1 == size2
** std::exception: **
bad argument

looking at the test which triggers this exception:

        size_type size () const {
            return BOOST_UBLAS_SAME (r1_.size (), r2_.size ());

r1_ and r2_ are the two ranges, for me (0,3) and (3,4) which are not of the
same size. Why must these ranges be the same size ? Maybe I have
misunderstood the doc and the matrix_vector_range concept... I want a
sub-vector of the 3 first elements of the last column of M.