Boost logo

Ublas :

From: Michael Stevens (mail_at_[hidden])
Date: 2006-05-18 12:41:53

Hello Olivier,

I finally got to take a look at this. Looks like a serious bug that effects
preserving resize for triangular and symmetric matrices.

Looking at the code the function matrix_resize_preserve is used and this
function is not suitable for packed matrices such as triangular and
symmetric. The results will be incorrect or as in your case a bad_index
exception will happen as elements are accessed past the end of the storage.

I looking at a simple (not particularly efficient) algorithm to get these
resizes working again.


On Wednesday, 22. February 2006 17:40, Olivier ROMERO wrote:

> I'm using the boost_1_33_1 library with MSVC++2005.
> When I used this code below : I've got a exception "bad_index". Do
> anyone of you know why ?
> typedef boost::numeric::ublas:: symmetric_matrix<int> SymetricMatrix;
> SymetricMatrix matrice;
> matrice.resize(2, true);
> matrice(0,1) = 10;
> matrice.resize(3, true); // exception raised in
> "detail::matrix_resize_preserve<layout_type> (*this, temporary) which
> call BOOST_UBLAS_CHECK (i < size_, bad_index ());"!!!

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