Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58483 - sandbox/numeric_bindings/libs/numeric/bindings/lapack/test
From: thomas.klimpel_at_[hidden]
Date: 2009-12-21 15:41:56


Author: klimpel
Date: 2009-12-21 15:41:55 EST (Mon, 21 Dec 2009)
New Revision: 58483
URL: http://svn.boost.org/trac/boost/changeset/58483

Log:
Continue of regression tests update
Text files modified:
   sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_hesv.cc | 20 ++++++++++++++------
   sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_hpsv.cc | 11 +++++++----
   sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_posv.cc | 17 +++++++++++------
   sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_ppsv.cc | 3 ++-
   sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_spsv.cc | 19 +++++++++++++------
   sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_sysv.cc | 26 ++++++++++++++++++--------
   6 files changed, 65 insertions(+), 31 deletions(-)

Modified: sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_hesv.cc
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_hesv.cc (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_hesv.cc 2009-12-21 15:41:55 EST (Mon, 21 Dec 2009)
@@ -6,8 +6,9 @@
 #include <cstddef>
 #include <iostream>
 #include <complex>
-#include <boost/numeric/bindings/lapack/hesv.hpp>
+#include <boost/numeric/bindings/lapack/driver/hesv.hpp>
 #include <boost/numeric/ublas/matrix_proxy.hpp>
+#include <boost/numeric/bindings/traits/ublas_vector.hpp>
 #include <boost/numeric/bindings/traits/ublas_matrix.hpp>
 #include <boost/numeric/bindings/traits/ublas_hermitian.hpp>
 #include <boost/numeric/bindings/traits/std_vector.hpp>
@@ -36,6 +37,8 @@
   cm_t cx (3, 1);
   cm_t cbl (3, 1), cbu (3, 1); // RHS
 
+ std::vector<integer_t> ipiv (3);
+
   hcal (0, 0) = cmplx_t (3, 0);
   hcal (1, 0) = cmplx_t (4, -2);
   hcal (1, 1) = cmplx_t (5, 0);
@@ -69,7 +72,9 @@
   cm_t cal2 (hcal), cau2 (hcau); // for part 2
   cm_t cbl2 (cbl), cbu2 (cbu);
 
- int ierr = lapack::hesv (hcal, cbl);
+// int ierr = lapack::hesv (hcal, cbl);
+// no ipiv less version is currently provided, so fall back to using ipiv
+ int ierr = lapack::hesv (hcal, ipiv, cbl);
   if (ierr == 0)
     print_m (cbl, "cxl");
   else
@@ -77,11 +82,10 @@
          << ierr << endl;
   cout << endl;
 
- std::vector<integer_t> ipiv (3);
   std::vector<cmplx_t> cwork (3*64);
   // 3*64 -- optimal size
 
- ierr = lapack::hesv (hcau, ipiv, cbu, cwork);
+ ierr = lapack::hesv (hcau, ipiv, cbu, lapack::workspace(cwork));
   if (ierr == 0) {
     print_v (ipiv, "ipiv");
     cout << endl;
@@ -112,7 +116,10 @@
   print_m (cbu2, "cbu2");
   cout << endl;
 
- ierr = lapack::hesv ('L', cal2, cbl2);
+ cherml_t hcal2(cal2);
+// ierr = lapack::hesv (hcal2, cbl2);
+// no ipiv less version is currently provided, so fall back to using ipiv
+ ierr = lapack::hesv (hcal2, ipiv, cbl2);
   if (ierr == 0)
     print_m (cbl2, "cxl2");
   else
@@ -120,7 +127,8 @@
          << ierr << endl;
   cout << endl;
 
- ierr = lapack::hesv ('U', cau2, ipiv, cbu2, cwork);
+ chermu_t hcau2(cau2);
+ ierr = lapack::hesv (hcau2, ipiv, cbu2, lapack::workspace(cwork));
   if (ierr == 0) {
     print_v (ipiv, "ipiv");
     cout << endl;

Modified: sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_hpsv.cc
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_hpsv.cc (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_hpsv.cc 2009-12-21 15:41:55 EST (Mon, 21 Dec 2009)
@@ -6,7 +6,8 @@
 #include <cstddef>
 #include <iostream>
 #include <complex>
-#include <boost/numeric/bindings/lapack/hpsv.hpp>
+#include <boost/numeric/bindings/lapack/driver/hpsv.hpp>
+#include <boost/numeric/bindings/traits/ublas_vector.hpp>
 #include <boost/numeric/bindings/traits/ublas_matrix.hpp>
 #include <boost/numeric/bindings/traits/ublas_hermitian.hpp>
 #include <boost/numeric/bindings/traits/std_vector.hpp>
@@ -37,6 +38,8 @@
   cm_t cx (3, 1);
   cm_t cbl (3, 1), cbu (3, 1); // RHS
 
+ std::vector<integer_t> ipiv (3);
+
   hcal (0, 0) = cmplx_t (3, 0);
   hcal (1, 0) = cmplx_t (4, -2);
   hcal (1, 1) = cmplx_t (5, 0);
@@ -67,7 +70,9 @@
   print_m (cbu, "cbu");
   cout << endl;
 
- int ierr = lapack::hpsv (hcal, cbl);
+// int ierr = lapack::hpsv (hcal, cbl);
+// no ipiv less version is currently provided, so fall back to using ipiv
+ int ierr = lapack::hpsv (hcal, ipiv, cbl);
   if (ierr == 0)
     print_m (cbl, "cxl");
   else
@@ -75,8 +80,6 @@
          << ierr << endl;
   cout << endl;
 
- std::vector<integer_t> ipiv (3);
-
   ierr = lapack::hpsv (hcau, ipiv, cbu);
   if (ierr == 0) {
     print_v (ipiv, "ipiv");

Modified: sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_posv.cc
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_posv.cc (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_posv.cc 2009-12-21 15:41:55 EST (Mon, 21 Dec 2009)
@@ -6,7 +6,8 @@
 #include <cstddef>
 #include <iostream>
 #include <complex>
-#include <boost/numeric/bindings/lapack/posv.hpp>
+#include <boost/numeric/bindings/lapack/driver/posv.hpp>
+#include <boost/numeric/bindings/traits/ublas_vector.hpp>
 #include <boost/numeric/bindings/traits/ublas_matrix.hpp>
 #include <boost/numeric/bindings/traits/ublas_symmetric.hpp>
 #include <boost/numeric/bindings/traits/ublas_hermitian.hpp>
@@ -100,13 +101,15 @@
 
   // part 2
 
- lapack::posv ('L', al1, bl1);
+ symml_t sal1(al1);
+ lapack::posv (sal1, bl1);
   print_m (al1, "al1 factored");
   cout << endl;
   print_m (bl1, "xl1");
   cout << endl;
 
- lapack::posv ('U', au1, bu1);
+ symmu_t sau1(au1);
+ lapack::posv (sau1, bu1);
   print_m (au1, "au1 factored");
   cout << endl;
   print_m (bu1, "xu");
@@ -248,8 +251,9 @@
   cm_t cbu2 (cbl2);
   print_m (cbl2, "cbl");
   cout << endl;
-
- ierr = lapack::posv ('L', cal, cbl2);
+
+ herml_t hcal (cal);
+ ierr = lapack::posv (hcal, cbl2);
   if (ierr == 0)
     print_m (cbl2, "cxl");
   else
@@ -257,7 +261,8 @@
          << ierr << endl << endl;
   cout << endl;
 
- ierr = lapack::posv ('U', cau, cbu2);
+ hermu_t hcau (cau);
+ ierr = lapack::posv (hcau, cbu2);
   if (ierr == 0)
     print_m (cbu2, "cxu");
   else

Modified: sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_ppsv.cc
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_ppsv.cc (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_ppsv.cc 2009-12-21 15:41:55 EST (Mon, 21 Dec 2009)
@@ -6,7 +6,8 @@
 #include <cstddef>
 #include <iostream>
 #include <complex>
-#include <boost/numeric/bindings/lapack/ppsv.hpp>
+#include <boost/numeric/bindings/lapack/driver/ppsv.hpp>
+#include <boost/numeric/bindings/traits/ublas_vector.hpp>
 #include <boost/numeric/bindings/traits/ublas_matrix.hpp>
 #include <boost/numeric/bindings/traits/ublas_symmetric.hpp>
 #include <boost/numeric/bindings/traits/ublas_hermitian.hpp>

Modified: sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_spsv.cc
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_spsv.cc (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_spsv.cc 2009-12-21 15:41:55 EST (Mon, 21 Dec 2009)
@@ -6,7 +6,8 @@
 #include <cstddef>
 #include <iostream>
 #include <complex>
-#include <boost/numeric/bindings/lapack/spsv.hpp>
+#include <boost/numeric/bindings/lapack/driver/spsv.hpp>
+#include <boost/numeric/bindings/traits/ublas_vector.hpp>
 #include <boost/numeric/bindings/traits/ublas_matrix.hpp>
 #include <boost/numeric/bindings/traits/ublas_symmetric.hpp>
 #include <boost/numeric/bindings/traits/std_vector.hpp>
@@ -66,6 +67,8 @@
   m_t x (n, nrhs);
   m_t bl (n, nrhs), bu (n, nrhs); // RHS matrices
 
+ std::vector<integer_t> ipiv (n);
+
   init_symm2 (sal);
   print_m (sal, "sal");
   cout << endl;
@@ -90,18 +93,20 @@
   symmu_t sau1 (sau);
   m_t bl1 (bl), bu1 (bu);
 
- lapack::spsv (sal, bl);
+// lapack::spsv (sal, bl);
+// no ipiv less version is currently provided, so fall back to using ipiv
+ lapack::spsv (sal, ipiv, bl);
   print_m (bl, "xl");
   cout << endl;
 
- lapack::spsv (sau, bu);
+// lapack::spsv (sau, bu);
+// no ipiv less version is currently provided, so fall back to using ipiv
+ lapack::spsv (sau, ipiv, bu);
   print_m (bu, "xu");
   cout << endl;
 
   // part 2
 
- std::vector<integer_t> ipiv (n);
-
   int err = lapack::spsv (sal1, ipiv, bl1);
   print_m (sal1, "sal1 factored");
   cout << endl;
@@ -150,7 +155,9 @@
   print_m (cbu, "cbu");
   cout << endl;
 
- int ierr = lapack::spsv (scal, cbl);
+// int ierr = lapack::spsv (scal, cbl);
+// no ipiv less version is currently provided, so fall back to using ipiv
+ int ierr = lapack::spsv (scal, ipiv, cbl);
   if (ierr == 0)
     print_m (cbl, "cxl");
   else

Modified: sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_sysv.cc
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_sysv.cc (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_sysv.cc 2009-12-21 15:41:55 EST (Mon, 21 Dec 2009)
@@ -6,7 +6,8 @@
 #include <cstddef>
 #include <iostream>
 #include <complex>
-#include <boost/numeric/bindings/lapack/sysv.hpp>
+#include <boost/numeric/bindings/lapack/driver/sysv.hpp>
+#include <boost/numeric/bindings/traits/ublas_vector.hpp>
 #include <boost/numeric/bindings/traits/ublas_matrix.hpp>
 #include <boost/numeric/bindings/traits/ublas_symmetric.hpp>
 #include <boost/numeric/bindings/traits/std_vector.hpp>
@@ -64,6 +65,8 @@
   m_t x (n, nrhs);
   m_t bl (n, nrhs), bu (n, nrhs); // RHS matrices
 
+ std::vector<integer_t> ipiv (n);
+
   init_symm2 (al);
   swap (row (al, 1), row (al, 4));
   swap (column (al, 1), column (al, 4));
@@ -93,20 +96,24 @@
   m_t al1 (al), au1 (au); // for part 2
   m_t bl1 (bl), bu1 (bu);
 
- lapack::sysv (sal, bl);
+// lapack::sysv (sal, bl);
+// no ipiv less version is currently provided, so fall back to using ipiv
+ lapack::sysv (sal, ipiv, bl);
   print_m (bl, "xl");
   cout << endl;
 
- lapack::sysv (sau, bu);
+// lapack::sysv (sau, bu);
+// no ipiv less version is currently provided, so fall back to using ipiv
+ lapack::sysv (sau, ipiv, bu);
   print_m (bu, "xu");
   cout << endl;
 
   // part 2
 
- std::vector<integer_t> ipiv (n);
   std::vector<real_t> work (1);
 
- int err = lapack::sysv ('L', al1, ipiv, bl1, work);
+ symml_t sal1 (al1);
+ int err = lapack::sysv (sal1, ipiv, bl1, lapack::workspace(work));
   print_m (al1, "al1 factored");
   cout << endl;
   print_v (ipiv, "ipiv");
@@ -114,7 +121,8 @@
   print_m (bl1, "xl1");
   cout << endl;
 
- err = lapack::sysv ('U', au1, ipiv, bu1, work);
+ symmu_t sau1 (au1);
+ err = lapack::sysv (sau1, ipiv, bu1, lapack::workspace(work));
   print_m (au1, "au1 factored");
   cout << endl;
   print_v (ipiv, "ipiv");
@@ -154,7 +162,9 @@
   print_m (cbu, "cbu");
   cout << endl;
 
- int ierr = lapack::sysv (scal, cbl);
+// int ierr = lapack::sysv (scal, cbl);
+// no ipiv less version is currently provided, so fall back to using ipiv
+ int ierr = lapack::sysv (scal, ipiv, cbl);
   if (ierr == 0)
     print_m (cbl, "cxl");
   else
@@ -164,7 +174,7 @@
 
   std::vector<cmplx_t> cwork (n);
 
- ierr = lapack::sysv (scau, ipiv, cbu, cwork);
+ ierr = lapack::sysv (scau, ipiv, cbu, lapack::workspace(cwork));
   if (ierr == 0) {
     print_v (ipiv, "ipiv");
     cout << endl;


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