|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r58443 - in sandbox/numeric_bindings: boost/numeric/bindings/lapack/auxiliary libs/numeric/bindings/lapack/test
From: thomas.klimpel_at_[hidden]
Date: 2009-12-17 18:17:21
Author: klimpel
Date: 2009-12-17 18:17:20 EST (Thu, 17 Dec 2009)
New Revision: 58443
URL: http://svn.boost.org/trac/boost/changeset/58443
Log:
Start of regression tests update
Text files modified:
sandbox/numeric_bindings/boost/numeric/bindings/lapack/auxiliary/ilaenv.hpp | 2 +-
sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_heev.cpp | 20 +++++++++++++-------
sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_syev.cpp | 21 +++++++++++++--------
3 files changed, 27 insertions(+), 16 deletions(-)
Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/auxiliary/ilaenv.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/auxiliary/ilaenv.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/auxiliary/ilaenv.hpp 2009-12-17 18:17:20 EST (Thu, 17 Dec 2009)
@@ -15,7 +15,7 @@
#define BOOST_NUMERIC_BINDINGS_LAPACK_ILAENV_HPP
#include <cstring>
-#include <boost/numeric/bindings/lapack/lapack.h>
+#include <boost/numeric/bindings/lapack/detail/lapack.h>
namespace boost { namespace numeric { namespace bindings { namespace lapack {
Modified: sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_heev.cpp
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_heev.cpp (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_heev.cpp 2009-12-17 18:17:20 EST (Thu, 17 Dec 2009)
@@ -8,9 +8,10 @@
#include "ublas_heev.hpp"
-#include <boost/numeric/bindings/lapack/heev.hpp>
+#include <boost/numeric/bindings/lapack/driver/heev.hpp>
#include <boost/numeric/bindings/traits/ublas_matrix.hpp>
#include <boost/numeric/bindings/traits/ublas_vector.hpp>
+#include <boost/numeric/bindings/traits/ublas_hermitian.hpp>
#include <boost/numeric/ublas/matrix_proxy.hpp>
#include <boost/numeric/ublas/vector_proxy.hpp>
#include <boost/numeric/ublas/io.hpp>
@@ -22,11 +23,12 @@
namespace lapack = boost::numeric::bindings::lapack;
-template <typename T, typename W, char UPLO>
+template <typename T, typename W, typename UPLO>
int do_memory_uplo(int n, W& workspace ) {
typedef typename boost::numeric::bindings::traits::type_traits<T>::real_type real_type ;
typedef ublas::matrix<T, ublas::column_major> matrix_type ;
+ typedef ublas::hermitian_adaptor<matrix_type, UPLO> hermitian_type ;
typedef ublas::vector<real_type> vector_type ;
// Set matrix
@@ -38,23 +40,27 @@
matrix_type a2( a );
// Compute Schur decomposition.
- lapack::heev( 'V', UPLO, a, e1, workspace ) ;
+ hermitian_type h_a( a );
+ lapack::heev( 'V', h_a, e1, workspace ) ;
if (check_residual( a2, e1, a )) return 255 ;
- lapack::heev( 'N', UPLO, a2, e2, workspace ) ;
+ hermitian_type h_a2( a2 );
+ lapack::heev( 'N', h_a2, e2, workspace ) ;
if (norm_2( e1 - e2 ) > n * norm_2( e1 ) * std::numeric_limits< real_type >::epsilon()) return 255 ;
// Test for a matrix range
fill( a ); a2.assign( a );
typedef ublas::matrix_range< matrix_type > matrix_range ;
+ typedef ublas::hermitian_adaptor<matrix_range, UPLO> hermitian_range_type ;
ublas::range r(1,n-1) ;
matrix_range a_r( a, r, r );
ublas::vector_range< vector_type> e_r( e1, r );
- lapack::heev( 'V', UPLO, a_r, e_r, workspace );
+ hermitian_range_type h_a_r( a_r );
+ lapack::heev( 'V', h_a_r, e_r, workspace );
matrix_range a2_r( a2, r, r );
if (check_residual( a2_r, e_r, a_r )) return 255 ;
@@ -66,9 +72,9 @@
template <typename T, typename W>
int do_memory_type(int n, W workspace) {
std::cout << " upper\n" ;
- if (do_memory_uplo<T,W,'U'>(n, workspace)) return 255 ;
+ if (do_memory_uplo<T,W,ublas::upper>(n, workspace)) return 255 ;
std::cout << " lower\n" ;
- if (do_memory_uplo<T,W,'L'>(n, workspace)) return 255 ;
+ if (do_memory_uplo<T,W,ublas::lower>(n, workspace)) return 255 ;
return 0 ;
}
Modified: sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_syev.cpp
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_syev.cpp (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_syev.cpp 2009-12-17 18:17:20 EST (Thu, 17 Dec 2009)
@@ -8,7 +8,7 @@
#include "ublas_heev.hpp"
-#include <boost/numeric/bindings/lapack/syev.hpp>
+#include <boost/numeric/bindings/lapack/driver/syev.hpp>
#include <boost/numeric/bindings/traits/ublas_matrix.hpp>
#include <boost/numeric/bindings/traits/ublas_symmetric.hpp>
#include <boost/numeric/bindings/traits/ublas_vector.hpp>
@@ -36,11 +36,12 @@
typedef ublas::lower_tag type ;
} ;
-template <typename T, typename W, char UPLO>
+template <typename T, typename W, typename UPLO>
int do_memory_uplo(int n, W& workspace ) {
typedef typename boost::numeric::bindings::traits::type_traits<T>::real_type real_type ;
typedef ublas::matrix<T, ublas::column_major> matrix_type ;
+ typedef ublas::symmetric_adaptor<matrix_type, UPLO> symmetric_type ;
typedef ublas::vector<real_type> vector_type ;
// Set matrix
@@ -52,30 +53,34 @@
matrix_type a2( a );
// Compute eigen decomposition.
- lapack::syev( 'V', UPLO, a, e1, workspace ) ;
+ symmetric_type s_a( a );
+ lapack::syev( 'V', s_a, e1, workspace ) ;
if (check_residual( a2, e1, a )) return 255 ;
- lapack::syev( 'N', UPLO, a2, e2, workspace ) ;
+ symmetric_type s_a2( a2 );
+ lapack::syev( 'N', s_a2, e2, workspace ) ;
if (norm_2( e1 - e2 ) > n * norm_2( e1 ) * std::numeric_limits< real_type >::epsilon()) return 255 ;
// Test for a matrix range
fill( a ); a2.assign( a );
typedef ublas::matrix_range< matrix_type > matrix_range ;
+ typedef ublas::symmetric_adaptor<matrix_range, UPLO> symmetric_range_type;
ublas::range r(1,n-1) ;
matrix_range a_r( a, r, r );
ublas::vector_range< vector_type> e_r( e1, r );
- lapack::syev('V', UPLO, a_r, e_r, workspace );
+ symmetric_range_type s_a_r( a_r );
+ lapack::syev('V', s_a_r, e_r, workspace );
matrix_range a2_r( a2, r, r );
if (check_residual( a2_r, e_r, a_r )) return 255 ;
// Test for symmetric_adaptor
fill( a ); a2.assign( a );
- ublas::symmetric_adaptor< matrix_type, typename translate_uplo<UPLO>::type > a_uplo( a ) ;
+ ublas::symmetric_adaptor< matrix_type, UPLO> a_uplo( a ) ;
lapack::syev( 'V', a_uplo, e1, workspace ) ;
if (check_residual( a2, e1, a )) return 255 ;
@@ -86,9 +91,9 @@
template <typename T, typename W>
int do_memory_type(int n, W workspace) {
std::cout << " upper\n" ;
- if (do_memory_uplo<T,W,'U'>(n, workspace)) return 255 ;
+ if (do_memory_uplo<T,W,ublas::upper>(n, workspace)) return 255 ;
std::cout << " lower\n" ;
- if (do_memory_uplo<T,W,'L'>(n, workspace)) return 255 ;
+ if (do_memory_uplo<T,W,ublas::lower>(n, workspace)) return 255 ;
return 0 ;
}
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