Boost logo

Ublas :

Subject: [ublas] Testing trtri
From: Jesse Perla (jesseperla_at_[hidden])
Date: 2009-03-19 12:46:49


Sorry this took me so long to test. I just updated the bindings today and
made sure that the traits and lapack are correctly in my headers:

>From Rutger:

> which you say they are triangular. I've added support for uplo detection
in

> trtri, to use it now please use ublas' triangular adaptor to indicate

>whether it is upper/lower.

trtri: ---------------------

Looking at the header tor trtri, it seems that we still have a parameter for
the diagonal which I don't quite get since the triangular matrices support
ublas::lower, ublas::unit_lower, etc. so the difference should be clear (or
is this what you were talking about with diagonal detection in your
response). Also, it would be really nice to have an overload which allowed
us to use the old notation such as lapack::trtri('L', 'N', A); because the
triangular adaptors are nice but a little syntactically messy for newbies.

I changed my code from:

ublas::matrix<double, ublas::column_major> A(2,2);

lapack::trtri('L', 'N', A);

to:

ublas::matrix<double, ublas::column_major> A(2,2);

ublas::triangular_adaptor<ublas::matrix<double, ublas::column_major>,
ublas::lower> tri_A (A);

lapack::trtri('N', tri_A);

And received the a bunch of missing traits:

1>C:\working\libraries\boost\boost/numeric/bindings/lapack/computational/trtri.hpp(77):
error: class
"boost::numeric::bindings::traits::matrix_traits<boost::numeric::ublas::triangular_adaptor<boost::numeric::ublas::matrix<double,
boost::numeric::ublas::column_major,
boost::numeric::ublas::unbounded_array<double,
std::allocator<QuantLib::Real={double}>>>, boost::numeric::ublas::lower>>"
has no member "value_type"

1> typedef typename traits::matrix_traits< MatrixA >::value_type
value_type;

...

1>C:\working\libraries\boost\boost/numeric/bindings/lapack/computational/trtri.hpp(56):
error: class "boost::numeric::bindings::traits::type_traits<<error-type>>"
has no member "real_type"

1> typedef typename traits::type_traits<ValueType>::real_type
real_type;

1>C:\working\libraries\boost\boost/numeric/bindings/traits/matrix_traits.hpp(139):
error: class
"boost::numeric::bindings::traits::matrix_traits<boost::numeric::ublas::triangular_adaptor<boost::numeric::ublas::matrix<double,
boost::numeric::ublas::column_major,
boost::numeric::ublas::unbounded_array<double,
std::allocator<QuantLib::Real={double}>>>, boost::numeric::ublas::lower>>"
has no member "uplo_type"

1> typedef typename matrix_traits<SymmM>::uplo_type uplo_t;