Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59222 - sandbox/numeric_bindings/libs/numeric/bindings/blas/test
From: rutger_at_[hidden]
Date: 2010-01-22 09:01:36


Author: rutger
Date: 2010-01-22 09:01:34 EST (Fri, 22 Jan 2010)
New Revision: 59222
URL: http://svn.boost.org/trac/boost/changeset/59222

Log:
updated vector2 and ublas_slice regressions

Text files modified:
   sandbox/numeric_bindings/libs/numeric/bindings/blas/test/ublas_slice.cpp | 36 ++++++++++-------------------
   sandbox/numeric_bindings/libs/numeric/bindings/blas/test/vector2.cpp | 48 ++++++++++++---------------------------
   2 files changed, 28 insertions(+), 56 deletions(-)

Modified: sandbox/numeric_bindings/libs/numeric/bindings/blas/test/ublas_slice.cpp
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/blas/test/ublas_slice.cpp (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/blas/test/ublas_slice.cpp 2010-01-22 09:01:34 EST (Fri, 22 Jan 2010)
@@ -8,15 +8,14 @@
 
 #include <algorithm>
 #include <boost/numeric/ublas/io.hpp>
-#include <boost/numeric/ublas/matrix.hpp>
-#include <boost/numeric/ublas/matrix_proxy.hpp>
-#include <boost/numeric/ublas/vector.hpp>
+#include <boost/numeric/bindings/ublas/matrix.hpp>
+#include <boost/numeric/bindings/ublas/matrix_proxy.hpp>
+#include <boost/numeric/bindings/ublas/vector.hpp>
+#include <boost/numeric/bindings/trans.hpp>
 #include <boost/numeric/bindings/blas/level3/gemm.hpp>
 #include <boost/numeric/bindings/blas/level1/axpy.hpp>
-#include <boost/numeric/bindings/traits/transpose.hpp>
-#include <boost/numeric/bindings/traits/ublas_matrix.hpp>
-#include <boost/numeric/bindings/traits/ublas_vector.hpp>
-#include <boost/numeric/bindings/traits/ublas_vector2.hpp>
+
+namespace bindings = boost::numeric::bindings;
 
 int
 main(int argc, char** argv)
@@ -33,17 +32,13 @@
                 
                 boost::numeric::ublas::matrix<double, boost::numeric::ublas::column_major> c(3, 3);
                 boost::numeric::bindings::blas::gemm(
- boost::numeric::bindings::traits::NO_TRANSPOSE,
- boost::numeric::bindings::traits::TRANSPOSE,
- 1.0, a, b, 0.0, c
+ 1.0, a, bindings::trans(b), 0.0, c
                 );
                 std::cout << "C=" << c << std::endl;
                 
                 boost::numeric::ublas::vector<double> d(1);
                 boost::numeric::bindings::blas::gemm(
- boost::numeric::bindings::traits::TRANSPOSE,
- boost::numeric::bindings::traits::NO_TRANSPOSE,
- 1.0, a, b, 0.0, d
+ 1.0, bindings::trans(a), b, 0.0, d
                 );
                 std::cout << "d=" << d << std::endl;
         }
@@ -62,17 +57,13 @@
                 
                 boost::numeric::ublas::bounded_matrix<double, 3, 3, boost::numeric::ublas::column_major> c;
                 boost::numeric::bindings::blas::gemm(
- boost::numeric::bindings::traits::NO_TRANSPOSE,
- boost::numeric::bindings::traits::TRANSPOSE,
- 1.0, a, b, 0.0, c
+ 1.0, a, bindings::trans(b), 0.0, c
                 );
                 std::cout << "C=" << c << std::endl;
                 
                 boost::numeric::ublas::bounded_vector<double, 1> d;
                 boost::numeric::bindings::blas::gemm(
- boost::numeric::bindings::traits::TRANSPOSE,
- boost::numeric::bindings::traits::NO_TRANSPOSE,
- 1.0, a, b, 0.0, d
+ 1.0, bindings::trans(a), b, 0.0, d
                 );
                 std::cout << "d=" << d << std::endl;
         }
@@ -81,6 +72,9 @@
         
         // A * B = C
         {
+
+ std::cout << "here..." << std::endl;
+
                 boost::numeric::ublas::bounded_matrix<double, 4, 3, boost::numeric::ublas::column_major> a;
                 for (std::size_t i = 0; i < a.size1(); ++i) for (std::size_t j = 0; j < a.size2(); ++j) a(i, j) = i * a.size2() + j;
                 std::cout << "A=" << a << std::endl;
@@ -92,8 +86,6 @@
                 boost::numeric::ublas::bounded_matrix<double, 4, 4, boost::numeric::ublas::column_major> c;
                 //boost::numeric::bindings::blas::gemm(a, b, c);
                 boost::numeric::bindings::blas::gemm(
- boost::numeric::bindings::traits::NO_TRANSPOSE,
- boost::numeric::bindings::traits::NO_TRANSPOSE,
                         1.0, a, b, 0.0, c);
                 std::cout << "C=" << c << std::endl;
         }
@@ -127,8 +119,6 @@
> c2 = boost::numeric::ublas::subrange(c, 0, 3, 0, 3);
                 //boost::numeric::bindings::blas::gemm(a2, b2, c2);
                 boost::numeric::bindings::blas::gemm(
- boost::numeric::bindings::traits::NO_TRANSPOSE,
- boost::numeric::bindings::traits::NO_TRANSPOSE,
                         1.0, a2, b2, 0.0, c2);
                 std::cout << "C2=" << c2 << std::endl;
                 std::cout << "C=" << c << std::endl;

Modified: sandbox/numeric_bindings/libs/numeric/bindings/blas/test/vector2.cpp
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/blas/test/vector2.cpp (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/blas/test/vector2.cpp 2010-01-22 09:01:34 EST (Fri, 22 Jan 2010)
@@ -7,22 +7,16 @@
 //
 
 #include <boost/numeric/ublas/io.hpp>
-#include <boost/numeric/ublas/matrix.hpp>
-#include <boost/numeric/ublas/matrix_proxy.hpp>
-#include <boost/numeric/ublas/vector.hpp>
-#include <boost/numeric/ublas/vector_proxy.hpp>
+#include <boost/numeric/bindings/ublas/matrix.hpp>
+#include <boost/numeric/bindings/ublas/matrix_proxy.hpp>
+#include <boost/numeric/bindings/ublas/vector.hpp>
+#include <boost/numeric/bindings/ublas/vector_proxy.hpp>
 #include <boost/numeric/bindings/blas/level3/gemm.hpp>
-#include <boost/numeric/bindings/traits/transpose.hpp>
-#include <boost/numeric/bindings/traits/c_array.hpp>
-#include <boost/numeric/bindings/traits/c_array2.hpp>
-#include <boost/numeric/bindings/traits/dense_traits.hpp>
-#include <boost/numeric/bindings/traits/std_valarray.hpp>
-#include <boost/numeric/bindings/traits/std_valarray2.hpp>
-#include <boost/numeric/bindings/traits/std_vector.hpp>
-#include <boost/numeric/bindings/traits/std_vector2.hpp>
-#include <boost/numeric/bindings/traits/ublas_matrix.hpp>
-#include <boost/numeric/bindings/traits/ublas_vector.hpp>
-#include <boost/numeric/bindings/traits/ublas_vector2.hpp>
+#include <boost/numeric/bindings/trans.hpp>
+#include <boost/numeric/bindings/std/valarray.hpp>
+#include <boost/numeric/bindings/std/vector.hpp>
+
+namespace bindings = boost::numeric::bindings;
 
 int
 main(int argc, char** argv)
@@ -40,17 +34,13 @@
                 
                 boost::numeric::ublas::matrix<double, boost::numeric::ublas::column_major> c(3, 3);
                 boost::numeric::bindings::blas::gemm(
- boost::numeric::bindings::traits::NO_TRANSPOSE,
- boost::numeric::bindings::traits::TRANSPOSE,
- 1.0, a, b, 0.0, c
+ 1.0, a, bindings::trans(b), 0.0, c
                 );
                 std::cout << "c=" << c << std::endl;
                 
                 boost::numeric::ublas::vector<double> d(1);
                 boost::numeric::bindings::blas::gemm(
- boost::numeric::bindings::traits::TRANSPOSE,
- boost::numeric::bindings::traits::NO_TRANSPOSE,
- 1.0, a, b, 0.0, d
+ 1.0, bindings::trans(a), b, 0.0, d
                 );
                 std::cout << "d=" << d << std::endl;
         }
@@ -74,17 +64,13 @@
                 
                 boost::numeric::ublas::matrix<double, boost::numeric::ublas::column_major> c(3, 3);
                 boost::numeric::bindings::blas::gemm(
- boost::numeric::bindings::traits::NO_TRANSPOSE,
- boost::numeric::bindings::traits::TRANSPOSE,
- 1.0, a, b, 0.0, c
+ 1.0, a, bindings::trans(b), 0.0, c
                 );
                 std::cout << "c=" << c << std::endl;
                 
                 std::vector<double> d(1);
                 boost::numeric::bindings::blas::gemm(
- boost::numeric::bindings::traits::TRANSPOSE,
- boost::numeric::bindings::traits::NO_TRANSPOSE,
- 1.0, a, b, 0.0, d
+ 1.0, bindings::trans(a), b, 0.0, d
                 );
                 std::cout << "d=[" << d.size() << "](";
                 for (std::size_t i = 0; i < d.size(); ++i) std::cout << (i > 0 ? "," : "") << d[i];
@@ -110,17 +96,13 @@
                 
                 boost::numeric::ublas::matrix<double, boost::numeric::ublas::column_major> c(3, 3);
                 boost::numeric::bindings::blas::gemm(
- boost::numeric::bindings::traits::NO_TRANSPOSE,
- boost::numeric::bindings::traits::TRANSPOSE,
- 1.0, a, b, 0.0, c
+ 1.0, a, bindings::trans(b), 0.0, c
                 );
                 std::cout << "c=" << c << std::endl;
                 
                 std::valarray<double> d(1);
                 boost::numeric::bindings::blas::gemm(
- boost::numeric::bindings::traits::TRANSPOSE,
- boost::numeric::bindings::traits::NO_TRANSPOSE,
- 1.0, a, b, 0.0, d
+ 1.0, bindings::trans(a), b, 0.0, d
                 );
                 std::cout << "d=[" << d.size() << "](";
                 for (std::size_t i = 0; i < d.size(); ++i) std::cout << (i > 0 ? "," : "") << d[i];


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