|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r51730 - in sandbox/numeric_bindings: boost/numeric/bindings/lapack boost/numeric/bindings/lapack/computational libs/numeric/bindings/tools/templates/computational
From: rutger_at_[hidden]
Date: 2009-03-12 02:59:35
Author: rutger
Date: 2009-03-12 02:59:33 EDT (Thu, 12 Mar 2009)
New Revision: 51730
URL: http://svn.boost.org/trac/boost/changeset/51730
Log:
Improved trtri/tptri support in lapack bindings
Added:
sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/tptri.hpp (contents, props changed)
sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/tptri.hpp (contents, props changed)
sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/trtri.hpp (contents, props changed)
Text files modified:
sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/trtri.hpp | 16 ++++++++--------
sandbox/numeric_bindings/boost/numeric/bindings/lapack/lapack.h | 10 ++++++++++
sandbox/numeric_bindings/boost/numeric/bindings/lapack/lapack_names.h | 6 ++++++
3 files changed, 24 insertions(+), 8 deletions(-)
Added: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/tptri.hpp
==============================================================================
--- (empty file)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/tptri.hpp 2009-03-12 02:59:33 EDT (Thu, 12 Mar 2009)
@@ -0,0 +1,83 @@
+//
+// Copyright (c) 2003--2009
+// Toon Knapen, Karl Meerbergen, Kresimir Fresl,
+// Thomas Klimpel and Rutger ter Borg
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// THIS FILE IS AUTOMATICALLY GENERATED
+// PLEASE DO NOT EDIT!
+//
+
+#ifndef BOOST_NUMERIC_BINDINGS_LAPACK_TPTRI_HPP
+#define BOOST_NUMERIC_BINDINGS_LAPACK_TPTRI_HPP
+
+#include <boost/assert.hpp>
+#include <boost/numeric/bindings/lapack/lapack.h>
+#include <boost/numeric/bindings/traits/traits.hpp>
+#include <boost/numeric/bindings/traits/type_traits.hpp>
+#include <boost/static_assert.hpp>
+#include <boost/type_traits/is_same.hpp>
+
+namespace boost {
+namespace numeric {
+namespace bindings {
+namespace lapack {
+
+//$DESCRIPTION
+
+// overloaded functions to call lapack
+namespace detail {
+ inline void tptri( char const uplo, char const diag, integer_t const n,
+ float* ap, integer_t& info ) {
+ LAPACK_STPTRI( &uplo, &diag, &n, ap, &info );
+ }
+ inline void tptri( char const uplo, char const diag, integer_t const n,
+ double* ap, integer_t& info ) {
+ LAPACK_DTPTRI( &uplo, &diag, &n, ap, &info );
+ }
+ inline void tptri( char const uplo, char const diag, integer_t const n,
+ traits::complex_f* ap, integer_t& info ) {
+ LAPACK_CTPTRI( &uplo, &diag, &n, traits::complex_ptr(ap), &info );
+ }
+ inline void tptri( char const uplo, char const diag, integer_t const n,
+ traits::complex_d* ap, integer_t& info ) {
+ LAPACK_ZTPTRI( &uplo, &diag, &n, traits::complex_ptr(ap), &info );
+ }
+}
+
+// value-type based template
+template< typename ValueType >
+struct tptri_impl {
+
+ typedef ValueType value_type;
+ typedef typename traits::type_traits<ValueType>::real_type real_type;
+
+ // templated specialization
+ template< typename MatrixAP >
+ static void compute( char const diag, MatrixAP& ap, integer_t& info ) {
+ BOOST_ASSERT( traits::matrix_uplo_tag(ap) == 'U' ||
+ traits::matrix_uplo_tag(ap) == 'L' );
+ BOOST_ASSERT( diag == 'N' || diag == 'U' );
+ BOOST_ASSERT( traits::matrix_num_columns(ap) >= 0 );
+ detail::tptri( traits::matrix_uplo_tag(ap), diag,
+ traits::matrix_num_columns(ap), traits::matrix_storage(ap),
+ info );
+ }
+};
+
+
+// template function to call tptri
+template< typename MatrixAP >
+inline integer_t tptri( char const diag, MatrixAP& ap ) {
+ typedef typename traits::matrix_traits< MatrixAP >::value_type value_type;
+ integer_t info(0);
+ tptri_impl< value_type >::compute( diag, ap, info );
+ return info;
+}
+
+}}}} // namespace boost::numeric::bindings::lapack
+
+#endif
Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/trtri.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/trtri.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/trtri.hpp 2009-03-12 02:59:33 EDT (Thu, 12 Mar 2009)
@@ -57,26 +57,26 @@
// templated specialization
template< typename MatrixA >
- static void compute( char const uplo, char const diag, MatrixA& a,
- integer_t& info ) {
- BOOST_ASSERT( uplo == 'U' || uplo == 'L' );
+ static void compute( char const diag, MatrixA& a, integer_t& info ) {
+ BOOST_ASSERT( traits::matrix_uplo_tag(a) == 'U' ||
+ traits::matrix_uplo_tag(a) == 'L' );
BOOST_ASSERT( diag == 'N' || diag == 'U' );
BOOST_ASSERT( traits::matrix_num_columns(a) >= 0 );
BOOST_ASSERT( traits::leading_dimension(a) >= std::max(1,
traits::matrix_num_columns(a)) );
- detail::trtri( uplo, diag, traits::matrix_num_columns(a),
- traits::matrix_storage(a), traits::leading_dimension(a),
- info );
+ detail::trtri( traits::matrix_uplo_tag(a), diag,
+ traits::matrix_num_columns(a), traits::matrix_storage(a),
+ traits::leading_dimension(a), info );
}
};
// template function to call trtri
template< typename MatrixA >
-inline integer_t trtri( char const uplo, char const diag, MatrixA& a ) {
+inline integer_t trtri( char const diag, MatrixA& a ) {
typedef typename traits::matrix_traits< MatrixA >::value_type value_type;
integer_t info(0);
- trtri_impl< value_type >::compute( uplo, diag, a, info );
+ trtri_impl< value_type >::compute( diag, a, info );
return info;
}
Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/lapack.h
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/lapack.h (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/lapack.h 2009-03-12 02:59:33 EDT (Thu, 12 Mar 2009)
@@ -1565,6 +1565,16 @@
integer_t const* ldx, double* ferr, double* berr, dcomplex_t* work,
double* rwork, integer_t* info );
+// Value-type variants of tptri
+void LAPACK_STPTRI( char const* uplo, char const* diag, integer_t const* n,
+ float* ap, integer_t* info );
+void LAPACK_DTPTRI( char const* uplo, char const* diag, integer_t const* n,
+ double* ap, integer_t* info );
+void LAPACK_CTPTRI( char const* uplo, char const* diag, integer_t const* n,
+ fcomplex_t* ap, integer_t* info );
+void LAPACK_ZTPTRI( char const* uplo, char const* diag, integer_t const* n,
+ dcomplex_t* ap, integer_t* info );
+
// Value-type variants of tptrs
void LAPACK_STPTRS( char const* uplo, char const* trans, char const* diag,
integer_t const* n, integer_t const* nrhs, float const* ap, float* b,
Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/lapack_names.h
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/lapack_names.h (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/lapack_names.h 2009-03-12 02:59:33 EDT (Thu, 12 Mar 2009)
@@ -570,6 +570,12 @@
#define LAPACK_CTPRFS FORTRAN_ID( ctprfs )
#define LAPACK_ZTPRFS FORTRAN_ID( ztprfs )
+// Value-type variants of tptri
+#define LAPACK_STPTRI FORTRAN_ID( stptri )
+#define LAPACK_DTPTRI FORTRAN_ID( dtptri )
+#define LAPACK_CTPTRI FORTRAN_ID( ctptri )
+#define LAPACK_ZTPTRI FORTRAN_ID( ztptri )
+
// Value-type variants of tptrs
#define LAPACK_STPTRS FORTRAN_ID( stptrs )
#define LAPACK_DTPTRS FORTRAN_ID( dtptrs )
Added: sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/tptri.hpp
==============================================================================
--- (empty file)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/tptri.hpp 2009-03-12 02:59:33 EDT (Thu, 12 Mar 2009)
@@ -0,0 +1,5 @@
+$TEMPLATE[tptri.all.UPLO.trait_of]
+AP
+$TEMPLATE[tptri.all.N.trait_of]
+AP
+$TEMPLATE[end]
Added: sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/trtri.hpp
==============================================================================
--- (empty file)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/trtri.hpp 2009-03-12 02:59:33 EDT (Thu, 12 Mar 2009)
@@ -0,0 +1,3 @@
+$TEMPLATE[trtri.all.UPLO.trait_of]
+A
+$TEMPLATE[end]
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