Boost logo

Ublas :

From: Pieter (PieterB_at_[hidden])
Date: 2007-09-25 03:20:17


LS,

Using boost version 1.34.1 and Visual C++ 2005, the following code
throws a bad_index exception when used with unit_lower triangular
matrices, while the same works fine for regular triangular matrices:

matrix<double> A(3,3);
triangular_matrix<double,unit_lower> UL(3,3);
// fill A
UL = getUnitLower(A);

with:

template<class T>
triangular_matrix<T,unit_lower>
getUnitLower(matrix<double> M) const
{
        triangular_adaptor<const matrix<T>, unit_lower> UL(M);
        return UL;
}

>From the documentation, I concluded that this should be legal to do, but
it seems the code attempts to assign the diagonal of UL. Is anyone aware
of this problem?

Many thanks,

Pieter