Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59042 - sandbox/numeric_bindings/libs/numeric/bindings/atlas
From: rutger_at_[hidden]
Date: 2010-01-15 09:17:44


Author: rutger
Date: 2010-01-15 09:17:44 EST (Fri, 15 Jan 2010)
New Revision: 59042
URL: http://svn.boost.org/trac/boost/changeset/59042

Log:
ublas_matr1 now passes regression

Text files modified:
   sandbox/numeric_bindings/libs/numeric/bindings/atlas/ublas_matr1.cc | 48 ++++++++++++++++++++--------------------
   1 files changed, 24 insertions(+), 24 deletions(-)

Modified: sandbox/numeric_bindings/libs/numeric/bindings/atlas/ublas_matr1.cc
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/atlas/ublas_matr1.cc (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/atlas/ublas_matr1.cc 2010-01-15 09:17:44 EST (Fri, 15 Jan 2010)
@@ -5,15 +5,15 @@
 //#define BOOST_NO_FUNCTION_TEMPLATE_ORDERING
 
 #include <iostream>
-#include <boost/numeric/bindings/traits/ublas_vector.hpp>
-#include <boost/numeric/bindings/traits/ublas_matrix.hpp>
-#include <boost/numeric/ublas/vector_proxy.hpp>
-#include <boost/numeric/ublas/matrix_proxy.hpp>
-#include <boost/numeric/bindings/atlas/cblas1.hpp>
+#include <boost/numeric/bindings/ublas/vector.hpp>
+#include <boost/numeric/bindings/ublas/matrix.hpp>
+#include <boost/numeric/bindings/ublas/matrix_proxy.hpp>
+#include <boost/numeric/bindings/ublas/vector_proxy.hpp>
+#include <boost/numeric/bindings/blas/level1.hpp>
 #include "utils.h"
 
-namespace atlas = boost::numeric::bindings::atlas;
-namespace traits = boost::numeric::bindings::traits;
+namespace blas = boost::numeric::bindings::blas;
+namespace bindings = boost::numeric::bindings;
 namespace ublas = boost::numeric::ublas;
 
 using std::cout;
@@ -40,24 +40,24 @@
   cout << endl;
 
   vct_t v (10);
- atlas::set (0., v);
+ blas::set (0., v);
   print_v (v, "v");
   cout << endl;
 
   // m[2,.] <- 0.1 m[2,.]
   mr_t mr2 (m, 2);
- atlas::scal (0.1, mr2);
+ blas::scal (0.1, mr2);
   print_m (m, "0.1 m[2,.]");
   cout << endl;
   
   // m[2,.] <-> m[4,.]
   mr_t mr4 (m, 4);
- atlas::swap (mr2, mr4);
+ blas::swap (mr2, mr4);
   print_m (m, "m[2,.] <-> m[4,.]");
   cout << endl;
 
   // m[4,.] <- m[2,.]
- atlas::copy (mr2, mr4);
+ blas::copy (mr2, mr4);
   print_m (m, "m[4,.] <- m[2,.]");
   cout << endl;
 
@@ -65,25 +65,25 @@
   mr_t mr5 (m, 5);
   ublas::vector_range<vct_t> vr (v, ublas::range (2, 6));
   ublas::vector_range<mr_t> mr5r (mr5, ublas::range (1, 5));
- atlas::axpy (10.0, mr5r, vr);
+ blas::axpy (10.0, mr5r, vr);
   print_v (v, "v[2..6] <- 10 m[5,.][1..5]");
   cout << endl;
 
   // ||m[.,3]||_1, ||m[.,3]||_2
   mc_t mc3 (m, 3);
- cout << "||m[.,3]||_1 = " << atlas::asum (mc3) << endl;
- cout << "||m[.,3]||_2 = " << atlas::nrm2 (mc3) << endl;
+ cout << "||m[.,3]||_1 = " << blas::asum (mc3) << endl;
+ cout << "||m[.,3]||_2 = " << blas::nrm2 (mc3) << endl;
   cout << endl;
   
   // m[.,5] <- 0.01 m[.,3] + m[.,5]
   mc_t mc5 (m, 5);
- atlas::axpy (0.01, mc3, mc5);
+ blas::axpy (0.01, mc3, mc5);
   print_m (m, "m[.,5] <- 0.01 m[.,3] + m[.,5]");
   cout << endl;
 
   // 0.1 m[.,5][1:2:3]
   ublas::vector_slice<mc_t> mc5s (mc5, ublas::slice (1, 2, 3));
- atlas::scal (0.1, mc5s);
+ blas::scal (0.1, mc5s);
   print_m (m, "0.1 m[.,5][1:2:3]");
   cout << endl;
 
@@ -91,7 +91,7 @@
   ublas::vector_slice<mr_t> mr4s (mr4, ublas::slice (1, 2, 4));
   ublas::vector_range<ublas::vector_slice<mr_t> >
     mr4sr (mr4s, ublas::range (1, 3));
- atlas::scal (0.1, mr4sr);
+ blas::scal (0.1, mr4sr);
   print_m (m, "0.1 m[4,.][1:2:4][1..3]");
   cout << endl;
 
@@ -100,11 +100,11 @@
 #ifndef F_USE_DETAIL
   for (int i = 0; i < m.size1(); ++i) {
     mr_t mri (m, i);
- atlas::scal (0.1, mri);
+ blas::scal (0.1, mri);
   }
 #else
   // cblas level 1 function applied to matrix
- atlas::detail::scal (traits::matrix_storage_size (m),
+ blas::detail::scal (traits::matrix_storage_size (m),
                        0.1, traits::matrix_storage (m), 1);
 #endif
   matr_t const cm (m);
@@ -119,19 +119,19 @@
   // mrng[1,.] <-> mrng[2,.]
   ublas::matrix_row<mrng_t> mrngr1 (mrng, 1);
   ublas::matrix_row<mrng_t> mrngr2 (mrng, 2);
- atlas::swap (mrngr1, mrngr2);
+ blas::swap (mrngr1, mrngr2);
   print_m (m, "mrng[1,.] <-> mrng[2,.]");
   cout << endl;
 
   // mrng[2,.] <-> mrng[1,.]
- atlas::swap (mrngr2, mrngr1);
+ blas::swap (mrngr2, mrngr1);
   print_m (m, "mrng[2,.] <-> mrng[1,.]");
   cout << endl;
 
   // mrng[.,3] <- 0.01 mrng[.,5] + mrng[.,3]
   ublas::matrix_column<mrng_t> mrngc3 (mrng, 3);
   ublas::matrix_column<mrng_t> const mrngc5 (mrng, 5);
- atlas::axpy (0.01, mrngc5, mrngc3);
+ blas::axpy (0.01, mrngc5, mrngc3);
   print_m (m, "mrng[.,3] <- 0.01 mrng[.,5] + mrng[.,3]");
   cout << endl;
 
@@ -142,13 +142,13 @@
 
   // ||cmsl[.,0]||_1
   ublas::matrix_column<cmsl_t> mslc0 (msl, 0);
- cout << "||cmsl[.,0]||_1 = " << atlas::asum (mslc0) << endl;
+ cout << "||cmsl[.,0]||_1 = " << blas::asum (mslc0) << endl;
   cout << endl;
 
   // mrng[.,3][1..4] <= 0.0001 cmsl[.,0] + mrng[.,3][1..4]
   ublas::vector_range<ublas::matrix_column<mrng_t> >
     vrmrngc3 (mrngc3, ublas::range (1, 4));
- atlas::axpy (0.0001, mslc0, vrmrngc3);
+ blas::axpy (0.0001, mslc0, vrmrngc3);
   print_m (m, "mrng[.,3][1..4] <= 0.0001 cmsl[.,0] + mrng[.,3][1..4]");
   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