|
Boost-Commit : |
From: thomas.klimpel_at_[hidden]
Date: 2008-07-06 07:58:01
Author: klimpel
Date: 2008-07-06 07:58:01 EDT (Sun, 06 Jul 2008)
New Revision: 47130
URL: http://svn.boost.org/trac/boost/changeset/47130
Log:
Add regression test for orgqr to ublas_qeqrf.cpp
Text files modified:
sandbox/libs/numeric/bindings/lapack/test/ublas_geqrf.cpp | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
Modified: sandbox/libs/numeric/bindings/lapack/test/ublas_geqrf.cpp
==============================================================================
--- sandbox/libs/numeric/bindings/lapack/test/ublas_geqrf.cpp (original)
+++ sandbox/libs/numeric/bindings/lapack/test/ublas_geqrf.cpp 2008-07-06 07:58:01 EDT (Sun, 06 Jul 2008)
@@ -10,6 +10,7 @@
#include <boost/numeric/bindings/lapack/geqrf.hpp>
#include <boost/numeric/bindings/lapack/ormqr.hpp>
+#include <boost/numeric/bindings/lapack/orgqr.hpp>
#include <boost/numeric/bindings/traits/ublas_matrix.hpp>
#include <boost/numeric/bindings/traits/ublas_vector.hpp>
#include <boost/numeric/ublas/triangular.hpp>
@@ -77,6 +78,7 @@
randomize( a );
matrix_type a2( a );
+ matrix_type a3( a );
// Compute QR factorization.
lapack::geqrf( a, tau, workspace ) ;
@@ -88,6 +90,13 @@
if (norm_frobenius( upper_part( a - a2 ) )
> std::numeric_limits<real_type>::epsilon() * 10.0 * norm_frobenius( upper_part( a ) ) ) return 255 ;
+ // Generate orthogonal matrix
+ lapack::orgqr( a, tau, workspace );
+
+ // The result of lapack::ormqr and the equivalent matrix product must be equal.
+ if (norm_frobenius( a2 - prod(herm(a), a3) )
+ > std::numeric_limits<real_type>::epsilon() * 10.0 * norm_frobenius( a2 ) ) return 255 ;
+
return 0 ;
} // do_value_type()
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