|
Boost-Commit : |
From: thomas.klimpel_at_[hidden]
Date: 2008-06-22 06:38:40
Author: klimpel
Date: 2008-06-22 06:38:39 EDT (Sun, 22 Jun 2008)
New Revision: 46602
URL: http://svn.boost.org/trac/boost/changeset/46602
Log:
added xPPTRI by Kian Ming A. Chai (14 May 2008)
Text files modified:
sandbox/boost/numeric/bindings/lapack/lapack.h | 7 ++++
sandbox/boost/numeric/bindings/lapack/ppsv.hpp | 58 +++++++++++++++++++++++++++++++++++++++
2 files changed, 64 insertions(+), 1 deletions(-)
Modified: sandbox/boost/numeric/bindings/lapack/lapack.h
==============================================================================
--- sandbox/boost/numeric/bindings/lapack/lapack.h (original)
+++ sandbox/boost/numeric/bindings/lapack/lapack.h 2008-06-22 06:38:39 EDT (Sun, 22 Jun 2008)
@@ -134,6 +134,13 @@
dcomplex_t const* ap,
dcomplex_t* b, int const* ldb, int* info);
+ void LAPACK_SPPTRI (char const* uplo, int const* n, float* ap, int* info);
+ void LAPACK_DPPTRI (char const* uplo, int const* n, double* ap, int* info);
+ void LAPACK_CPPTRI (char const* uplo, int const* n,
+ fcomplex_t* ap, int* info);
+ void LAPACK_ZPPTRI (char const* uplo, int const* n,
+ dcomplex_t* ap, int* info);
+
/* symmetric/Hermitian indefinite and complex symmetric */
Modified: sandbox/boost/numeric/bindings/lapack/ppsv.hpp
==============================================================================
--- sandbox/boost/numeric/bindings/lapack/ppsv.hpp (original)
+++ sandbox/boost/numeric/bindings/lapack/ppsv.hpp 2008-06-22 06:38:39 EDT (Sun, 22 Jun 2008)
@@ -10,6 +10,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
@@ -263,7 +264,62 @@
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 <typename SymmMatrA>
+ 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<SymmMatrA>::matrix_structure,
+ typename traits::detail::symm_herm_pack_t<
+ typename traits::matrix_traits<SymmMatrA>::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;
+ }
+
}
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk