Lu_substitute is failing for matrix order >5

[email protected]
Newsgroups gmane.comp.lib.boost.ublas
Message-ID <339992806.423291.1359675278941.JavaMail.www@wwinf8314>
Hello folks,
I am very new at using boost,
I wanted to invert a matrix, in order to solve a least_square_mean problem
Sadly the inversion works for a matrix order less then 6 but not for more
The code I am using is from http://savingyoutime.wordpress.com/2009/09/21/c-matrix-inversion-boostublas/
Apparently it fails while executing lu_subsitute

Any hints ont what happen ?
thanks

template
bool InvertMatrix(const matrix& input, matrix& inverse){ //thks to 
typedef permutation_matrix pmatrix;
// create a working copy of the input
matrix A(input);

// create a permutation matrix for the LU-factorization
pmatrix pm(A.size1());
// perform LU-factorization
int res = lu_factorize(A, pm);
cout<<"\n No fail while factorization";
if (res != 0){
return false;
}
cout<<"\n A is:\n"< (A.size1()));
// backsubstitute to get the inverse
cout<<"\n Isgoing to inver";
lu_substitute(A, pm, inverse);
return true;
}

Output of A and pm are in this past

http://paste.opensuse.org/32062940


The error message
Check failed in file /usr/include/boost/numeric/ublas/lu.hpp at line 299:
detail::expression_type_check (prod (triangular_adaptor (m), e), cm2)
terminate called after throwing an instance of 'boost::numeric::ublas::internal_logic'
what(): internal logic


Une messagerie gratuite, garantie à vie et des services en plus, ça vous tente ?
Je crée ma boîte mail www.laposte.net
_______________________________________________
ublas mailing list
[email protected]
http://lists.boost.org/mailman/listinfo.cgi/ublas
Sent to: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.