--- ppsv.hpp.orig 2008-05-14 14:59:33.000000000 +0100 +++ ppsv.hpp 2008-06-09 12:21:02.465914000 +0100 @@ -13,6 +13,7 @@ * University of Zagreb, Croatia. * */ +/* Modified to include xPPTRI by Kian Ming A. Chai (14 May 2008) */ #ifndef BOOST_NUMERIC_BINDINGS_LAPACK_PPSV_HPP #define BOOST_NUMERIC_BINDINGS_LAPACK_PPSV_HPP @@ -266,7 +267,62 @@ namespace boost { namespace numeric { na return info; } - // TO DO: pptri() + + /* + * pptri() computes the inverse of a real symmetric positive definite + * matrix A using the Cholesky factorization A = U**T*U or A = L*L**T + * computed by pptrf(). + */ + + namespace detail { + + inline + void pptri (char const uplo, int const n, float* ap, int* info) { + LAPACK_SPPTRI (&uplo, &n, ap, info); + } + + inline + void pptri (char const uplo, int const n, double* ap, int* info) { + LAPACK_DPPTRI (&uplo, &n, ap, info); + } + + inline + void pptri (char const uplo, int const n, + traits::complex_f* ap, int* info) + { + LAPACK_CPPTRI (&uplo, &n, traits::complex_ptr (ap), info); + } + + inline + void pptri (char const uplo, int const n, + traits::complex_d* ap, int* info) + { + LAPACK_ZPPTRI(&uplo, &n, traits::complex_ptr (ap), info); + } + + } + + template + inline + int pptri (SymmMatrA& a) { //ISSUE: More correctly, triangular matrix + +#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK + BOOST_STATIC_ASSERT((boost::is_same< + typename traits::matrix_traits::matrix_structure, + typename traits::detail::symm_herm_pack_t< + typename traits::matrix_traits::value_type + >::type + >::value)); +#endif + + int const n = traits::matrix_size1 (a); + assert (n == traits::matrix_size2 (a)); + char uplo = traits::matrix_uplo_tag (a); + int info; + detail::pptri (uplo, n, traits::matrix_storage (a), &info); + return info; + } + }