Boost logo

Ublas :

Subject: [ublas] Testing the new bindings
From: Jesse Perla (jesseperla_at_[hidden])
Date: 2009-02-28 10:53:16


There is a bug in the current version of the bindings script. See line 63
of the lapack_generator.py, which doesn't close the ">" for the
static_assert include. I don't have the LAPACK source, so can't rerun the
python script on my own. I am using Intel C++ 11.0 on windows.
When I:
1) Copied over the current sandbox lapack and blas bindings
2) Merged the numeric bindings traits with an older copy of the traits I had
(because the sandbox copy is missing a lot of them, this is my likely
problem)
3) Make the text replace to the static_assert to close it properly

Then, I get a failure on the matrix traits (perhaps because I have an older
version):
1>C:\working\libraries\boost\boost/numeric/bindings/lapack/driver/gesv.hpp(68):
error: too few arguments for class template "boost::is_same"
1> BOOST_STATIC_ASSERT( boost::is_same< typename
traits::matrix_traits<
1> ^
1> detected during:
1> instantiation of "void
boost::numeric::bindings::lapack::gesv_impl<ValueType>::compute(MatrixA &,
VectorIPIV &, MatrixB &, integer_t={int} &) [with ValueType=double,
MatrixA=boost::numeric::ublas::matrix<double,
boost::numeric::ublas::column_major,
boost::numeric::ublas::unbounded_array<double,
std::allocator<QuantLib::Real={double}>>>,
VectorIPIV=std::vector<ptrdiff_t={int}, std::allocator<int>>,
MatrixB=boost::numeric::ublas::matrix<double,
boost::numeric::ublas::column_major,
1> boost::numeric::ublas::unbounded_array<double,
std::allocator<QuantLib::Real={double}>>>]" at line 93
1> instantiation of "integer_t={int}
boost::numeric::bindings::lapack::gesv(MatrixA &, VectorIPIV &, MatrixB &)
[with MatrixA=boost::numeric::ublas::matrix<double,
boost::numeric::ublas::column_major,
boost::numeric::ublas::unbounded_array<double,
std::allocator<QuantLib::Real={double}>>>,
VectorIPIV=std::vector<ptrdiff_t={int}, std::allocator<int>>,
MatrixB=boost::numeric::ublas::matrix<double,
boost::numeric::ublas::column_major,
boost::numeric::ublas::unbounded_array<double,
1> std::allocator<QuantLib::Real={double}>>>]" at line
61 of "C:\working\etk_lib\test_suite\etk_testsuite\test_ublas.cpp"

On a quick review of the traits classes, I didn't see any value_type , but I
don't really know what I am doing...
When I comment out the STATIC_ASSERT, the bindings work for gesv. My matrix
types are definitely the same here.

Note, here is my test code:
ublas::matrix<double, column_major> A(3,3);
A(0,0) = 2; A(0,1) = 0; A(0,2) = 0;
A(1,0) = 0; A(1,1) = 1; A(1,2) = 0;
A(2,0) = 0; A(2,1) = 0; A(2,2) = 2;

ublas::matrix<double, column_major> b(3,1);
b(0,0) = 2;
b(1,0) = 1;
b(2,0) = 2;

std::vector<int> ipiv (3);
lapack::gesv(A, ipiv, b);
cout << b;
//Gives the proper answer after the above changes