Boost logo

Ublas :

Subject: Re: [ublas] boost::ublas lu_substitute runtime error
From: mga-mga (mga-mga_at_[hidden])
Date: 2011-08-16 10:02:16


Hello!

Thank you so much for your quick answer! Actually, there are printouts
showing that both original matrix and the matrix holding the inverted
version are both of the same size. Here is the procedure I used for
inversion, with debug printouts (which are redundant, please do not pay
attention) as appropriate:

template <class T>
static bool invertMatrix(matrix<T>& orig, matrix<T>& inverted)
{
    cout << "Orig Matrix size: " << orig.size1() << " " << orig.size2() <<
endl;
    cout << "Inv Matrix size: " << inverted.size1() << " " <<
inverted.size2() << endl;
    
    typedef permutation_matrix<std::size_t> pmatrix;
    matrix<T> A(orig);
    pmatrix pm(A.size1());

    // perform LU-factorization
    int res = lu_factorize(A,pm);
    if( res != 0 ) return false;

    cout << "calling assign, size a: " << A.size1() << " " <<
inverted.size1() << endl;;
    inverted.assign(identity_matrix<T>(A.size1()));

    cout << "A Matrix size: " << A.size1() << " " << A.size2() << endl;
    cout << "PM Matrix size: " << pm.size() << endl;
    lu_substitute(A, pm, inverted);

    return true;
}

And here are the printouts:

Orig Matrix size: 7 7
Inv Matrix size: 7 7
calling assign, size a: 7 7
A Matrix size: 7 7
PM Matrix size: 7
Check failed in file /usr/local/include/boost/numeric/ublas/lu.hpp at line
294:
detail::expression_type_check (prod
(triangular_adaptor&lt;const_matrix_type, upper&gt; (m), e), cm2)

Sorry, I forgot to mention: I'm using RedHat + boost 1.42.0

WBR, Andrey

--
View this message in context: http://boost.2283326.n4.nabble.com/boost-ublas-lu-substitute-runtime-error-tp3747071p3747294.html
Sent from the Boost - uBLAS mailing list archive at Nabble.com.