|
Ublas : |
From: Song Chang (chang8217_at_[hidden])
Date: 2008-01-16 10:15:54
I am using LU decomposition to solve linear system with ublas,
and I just cannot figure the error apeared like this:
Check failed in file d:\lib\boost_1_34_1\boost\numeric\ublas\lu.hpp at
line 272:
detail::expression_type_check (prod
(triangular_adaptor<const_matrix_type, upper
> (m), e), cv2)
lu_factorize(A,pm) seems working well, but lu_substitute(A, pm, x)
sometimes throws
the exception above.
my code:
template<class T>
int lusolver(ublas::matrix<T>& A, ublas::vector<T>& x, ublas::vector<T>& b){
x = b;
ublas::permutation_matrix<std::size_t> pm(A.size1());
int res = ublas::lu_factorize(A,pm);
if( res != 0 ) return 1;
ublas::lu_substitute(A, pm, x);
return 0;}
anybody can help me? thanks a lot.
--------------------------------------
Easy + Joy + Powerful = Yahoo! Bookmarks x Toolbar
http://pr.mail.yahoo.co.jp/toolbar/