Re: [ublas-dev] atlas bindings question (cholesky_factor)
- Hi Hendrik,
> I am brand new to uBlas and the bindings.There are some examples in libs/numerics/bindings/atlas.
> I installed the latest versions for both from the Files section and
> spent many hours today trying to get a tiny piece of code working
> (which is normal for a complex and heavily templated library like
> this, I am not complaining).
In particular, examples of Cholesky factorisation are in
ublas_posv.cc, ublas_potrf_potrs.cc, ublas_potri.cc.
> I wanted to use the Atlas cholesky factorization on a ublasYes, it can't be done -- see below.
> symmetric matrix and did not manage to get it working.
> In the end I managed to get the cholesky_factor to work using aThis the The Way.
> symmetric_adaptor on the standard ublas matrix type.
> I also tried to use the symmetric_adaptor on theAgain: impossible.
> ublas::symmetric_matrix but that did not work either.
> So I guess I have to use the standard (full) matrix instead of theYes. cholesky_factor is just another name for ATLAS
(in fact LAPACK) function [sdcz]potrf. And `po' family of
functions operate on full matrices (that is, as you discovered,
standard ublas matrices wrapped in symmetric_adaptor);
here's a quote from dpotrf man page:
A (input/output) DOUBLE PRECISION array, dimension (LDA,N)
On entry, the symmetric matrix A. If UPLO = 'U', the leading
N-by-N upper triangular part of A contains the upper triangular
part of the matrix A, and the strictly lower triangular part of
A is not referenced. If UPLO = 'L', the leading N-by-N lower
triangular part of A contains the lower triangular part of the
matrix A, and the strictly upper triangular part of A is not
> Or is there some way to use cholesky_factor()No. In LAPACK, but not in ATLAS (and not in LAPACK bindings
> function with the ublas::symmetric_matrix?
yet) there is a `pp' family of functions (e.g. dppsv, dpptrf, dpptrs)
for Cholesky factorisation of a matrix in `packed' format (which
corresponds to ublas::symmetric_matrix.
Hope this helps,