From 72fdcae306b4d57c018d2bdb3ed593191e0fa525 Mon Sep 17 00:00:00 2001
From: Thomas Toulorge <thomas.toulorge@mines-paristech.fr>
Date: Mon, 11 Jun 2012 13:37:48 +0000
Subject: [PATCH] Fixed "multWithATranspose" in class fullMatrix for
 consistency with BLAS

---
 Numeric/fullMatrix.cpp | 3 +--
 Numeric/fullMatrix.h   | 6 +++---
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/Numeric/fullMatrix.cpp b/Numeric/fullMatrix.cpp
index 52314e78d1..7c16cddc1c 100644
--- a/Numeric/fullMatrix.cpp
+++ b/Numeric/fullMatrix.cpp
@@ -168,10 +168,9 @@ void fullMatrix<double>::multOnBlock(const fullMatrix<double> &b, const int ncol
 }
 
 template<>
-void fullMatrix<double>::multWithATranspose(const fullVector<double> &x, const int alpha_, const int beta_,fullVector<double> &y) const
+void fullMatrix<double>::multWithATranspose(const fullVector<double> &x, double alpha, double beta,fullVector<double> &y) const
 {
   int M = _r, N = _c, LDA = _r, INCX = 1, INCY = 1;
-  double alpha = alpha_, beta = beta_;
   F77NAME(dgemv)("T", &M, &N, &alpha, _data, &LDA, x._data, &INCX,
                  &beta, y._data, &INCY);
 
diff --git a/Numeric/fullMatrix.h b/Numeric/fullMatrix.h
index f84385b966..0a4c8d0c3f 100644
--- a/Numeric/fullMatrix.h
+++ b/Numeric/fullMatrix.h
@@ -551,13 +551,13 @@ class fullMatrix
 #endif
   ;
 
-  void multWithATranspose(const fullVector<scalar> &x, const int alpha_, const int beta_, fullVector<scalar> &y) const
+  void multWithATranspose(const fullVector<scalar> &x, scalar alpha, scalar beta, fullVector<scalar> &y) const
 #if !defined(HAVE_BLAS)
   {
-    y.scale(beta_);
+    y.scale(beta);
     for(int j = 0; j < _c; j++)
       for(int i = 0; i < _r; i++)
-        y._data[j] += (*this)(i, j) * x(i);
+        y._data[j] += alpha * (*this)(i, j) * x(i);
   }
 #endif
   ;
-- 
GitLab