|
Ublas : |
Subject: Re: [ublas] Example of use of boost::numeric::bindings::lapack with symmetric or triangular matrices?
From: Rutger ter Borg (rutger_at_[hidden])
Date: 2011-06-10 05:36:03
On 2011-06-10 00:33, Douglas Bates wrote:
> I am struggling to determine how to use the lapack bindings. As a
> simple example, how would use potrf declared in
> boost/numeric/bindings/lapack/computational/potrf.hpp to evaluate the
> Cholesky decomposition of a positive definite symmetric matrix. I
> can't decide what type of matrix to pass to it. On input it is a
> symmetric matrix but on output it is a triangular matrix.
>
> On a more general level, are there code examples using the lapack
> bindings that I could study?
Hello Douglas,
The lapack naming scheme is right here
http://www.netlib.org/lapack/lug/node24.html
Although being incomplete, you may find the bindings-documentation of
potrf here http://goo.gl/0ZGF6
In the case of potrf, you should pass a dense (normal) matrix.
Now, LAPACK needs to know whether your data is in the upper or lower
part of that matrix, it might use the other part of the matrix as
workspace. Please try something like
lapack::potrf( bindings::upper( a ) );
(PO already implies symmetric, so IIRC there's no need to add the symm()
adaptor).
HTH,
Cheers,
Rutger