|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r60733 - sandbox/numeric_bindings/libs/numeric/bindings/atlas
From: thomas.klimpel_at_[hidden]
Date: 2010-03-20 08:23:25
Author: klimpel
Date: 2010-03-20 08:23:24 EDT (Sat, 20 Mar 2010)
New Revision: 60733
URL: http://svn.boost.org/trac/boost/changeset/60733
Log:
ublas_getri now passes
Text files modified:
sandbox/numeric_bindings/libs/numeric/bindings/atlas/ublas_getri.cc | 20 +++++++++++---------
1 files changed, 11 insertions(+), 9 deletions(-)
Modified: sandbox/numeric_bindings/libs/numeric/bindings/atlas/ublas_getri.cc
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/atlas/ublas_getri.cc (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/atlas/ublas_getri.cc 2010-03-20 08:23:24 EDT (Sat, 20 Mar 2010)
@@ -9,13 +9,15 @@
#include <iostream>
#include <complex>
#include <boost/numeric/bindings/blas/level3.hpp>
-#include <boost/numeric/bindings/atlas/clapack.hpp>
+#include <boost/numeric/bindings/lapack/computational/getri.hpp>
+#include <boost/numeric/bindings/lapack/computational/getrf.hpp>
#include <boost/numeric/bindings/ublas/matrix.hpp>
-#include <boost/numeric/bindings/traits/std_vector.hpp>
+#include <boost/numeric/bindings/std/vector.hpp>
#include "utils.h"
namespace ublas = boost::numeric::ublas;
namespace blas = boost::numeric::bindings::blas;
+namespace lapack = boost::numeric::bindings::lapack;
using std::size_t;
using std::cout;
@@ -50,12 +52,12 @@
m_t aa (a); // copy of a, for later use
std::vector<int> ipiv (n); // pivot vector
- blas::lu_factor (a, ipiv); // alias for getrf()
- blas::lu_invert (a, ipiv); // alias for getri()
+ lapack::getrf (a, ipiv); // no lu_factor() alias for getrf() available
+ lapack::getri (a, ipiv); // no lu_invert() alias for getrf() available
m_t i1 (n, n), i2 (n, n);
- blas::gemm (a, aa, i1); // i1 should be (almost) identity matrix
- blas::gemm (aa, a, i2); // i2 should be (almost) identity matrix
+ blas::gemm (1.0, a, aa, 0.0, i1); // i1 should be (almost) identity matrix
+ blas::gemm (1.0, aa, a, 0.0, i2); // i2 should be (almost) identity matrix
print_m (i1, "I = A^(-1) * A");
cout << endl;
@@ -87,12 +89,12 @@
int ierr = lapack::getrf (ca, ipiv2);
if (ierr == 0) {
- blas::getri (ca, ipiv2);
+ lapack::getri (ca, ipiv2);
cm_t ii (3, 3);
- blas::gemm (ca, caa, ii);
+ blas::gemm (1.0, ca, caa, 0.0, ii);
print_m (ii, "I = CA^(-1) * CA");
cout << endl;
- blas::gemm (caa, ca, ii);
+ blas::gemm (1.0, caa, ca, 0.0, ii);
print_m (ii, "I = CA * CA^(-1)");
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