boost/numeric/ublas/lu.hpp

Brad Bell <[email protected]>
Newsgroups gmane.comp.lib.boost.ublas
Message-ID <[email protected]>
I am trying to understand the requirements for the scalar type used with
boost/numeric/ublas/lu.hpp
In particular, the following program; see
     https://github.com/coin-or/CppAD/blob/master/bug/boost_lu.sh
------------
# include <cppad/cppad.hpp>
# include <boost/numeric/ublas/lu.hpp>
int main() {
     typedef CppAD::AD<double> T;
     boost::numeric::ublas::matrix<T> a(5,5);
     boost::numeric::ublas::permutation_matrix<std::size_t> pert(5);
     // lu decomposition
     const std::size_t s = lu_factorize(a, pert);
     return 0;
}
----------
generates an error of the form
... snip ...
/usr/include/boost/numeric/ublas/detail/matrix_assign.hpp:33:35:
     error: no match for ‘operator<’
     ... snip ...
     return norm_inf (e1 - e2) < epsilon *
     ... snip ...

If I make the following change to matrix_assign.hpp, I do not get the 
compile error:

Old Text:
     return norm_inf (e1 - e2) < epsilon *
     std::max<S> (std::max<S> (norm_inf (e1), norm_inf (e2)), min_norm);
New Text:
     S norm_1 = norm_inf(e1);
     S norm_2 = norm_inf(e2);
     S norm_diff = norm_inf(e1 - e2);
     return norm_diff < epsilon * std::max( std::max<S>(norm_1, norm_2) 
, min_norm );





_______________________________________________
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.