Boost logo

Ublas :

Subject: [ublas] Testing getri
From: Jesse Perla (jesseperla_at_[hidden])
Date: 2009-03-19 13:15:06


> //Then can get the inverse
> lapack::getri(A, ipiv, lapack::optimal_workspace() );
>
> ... optimal_workspace() is compiling now, but is it working?

> From Rutger:

> If you would like to see what workspace size has been chosen, you could
> insert a

> std::cout << "Workspace real size: " << traits::detail::to_int(
> opt_size_work ) << std::endl;

> at line 110/111 of getri.

It sounds like if I have the optimal workspace compiling, then it "probably"
is working? Not much that can go wrong there? Either LAPACK has enough
memory to mess with, or it doesn't and probably would crash?

Also, I am perplexed by the following:

I can compile:

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

std::vector<int> ipiv (2); // pivot vector

lapack::getri(A, ipiv, lapack::optimal_workspace() );

But not the following, which should work from the default function
arguments?:

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

std::vector<int> ipiv (2); // pivot vector

lapack::getri(A, ipiv);

yields:

1>C:\working\etk_lib\test_suite\etk\test_ublas.cpp(121): error: no instance
of function template "boost::numeric::bindings::lapack::getri" matches the
argument list

1> argument types are: (boost::numeric::ublas::matrix<double,
boost::numeric::ublas::column_major,
boost::numeric::ublas::unbounded_array<double,
std::allocator<QuantLib::Real>>>, std::vector<ptrdiff_t,
std::allocator<int>>)

1> lapack::getri(A, ipiv);

-Jesse