Loading ...
Sorry, an error occurred while loading the content.
 

Re: [ublas-dev] atlas bindings question (cholesky_factor)

Expand Messages
  • Kresimir Fresl
    Hi Hendrik, ... There are some examples in libs/numerics/bindings/atlas. In particular, examples of Cholesky factorisation are in ublas_posv.cc,
    Message 1 of 2 , Aug 1, 2003
      Hi Hendrik,

      you wrote:

      > I am brand new to uBlas and the bindings.
      > 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).

      There are some examples in libs/numerics/bindings/atlas.
      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 ublas
      > symmetric matrix and did not manage to get it working.

      Yes, it can't be done -- see below.

      > In the end I managed to get the cholesky_factor to work using a
      > symmetric_adaptor on the standard ublas matrix type.

      This the The Way.

      > I also tried to use the symmetric_adaptor on the
      > ublas::symmetric_matrix but that did not work either.

      Again: impossible.

      > So I guess I have to use the standard (full) matrix instead of the
      > ublas::symmetric_matrix?

      Yes. 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
      referenced.

      > Or is there some way to use cholesky_factor()
      > function with the ublas::symmetric_matrix?

      No. In LAPACK, but not in ATLAS (and not in LAPACK bindings
      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,

      fres
    Your message has been successfully submitted and would be delivered to recipients shortly.