From 9917c50c608853b623b65fe00d92c09049ff10fc Mon Sep 17 00:00:00 2001
From: Jonathan Lambrechts <jonathan.lambrechts@uclouvain.be>
Date: Thu, 20 May 2010 07:19:27 +0000
Subject: [PATCH] fullMatrix<complex> blas scale

---
 Numeric/fullMatrix.cpp | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/Numeric/fullMatrix.cpp b/Numeric/fullMatrix.cpp
index d0dd089e39..3927e9af1d 100644
--- a/Numeric/fullMatrix.cpp
+++ b/Numeric/fullMatrix.cpp
@@ -38,6 +38,7 @@ extern "C" {
                       std::complex<double> *x, int *incx, std::complex<double> *beta, 
                       std::complex<double> *y, int *incy);
   void F77NAME(dscal)(int *n, double *alpha,double *x,  int *incx);
+  void F77NAME(zscal)(int *n, std::complex<double> *alpha,std::complex<double> *x,  int *incx);
 }
 
 template<> 
@@ -53,10 +54,14 @@ void fullMatrix<double>::scale(const double s) {
   int stride = 1;
   double ss = s;
   F77NAME(dscal)(&N, &ss,_data, &stride);
-    /*if(s == 0.)
-      for(int i = 0; i < _r * _c; ++i) _data[i] = 0.;
-    else
-      for(int i = 0; i < _r * _c; ++i) _data[i] *= s;*/
+}
+
+template<> 
+void fullMatrix<std::complex<double> >::scale(const double s) {
+  int N = _r*_c;
+  int stride = 1;
+  std::complex<double> ss = (s,0);
+  F77NAME(zscal)(&N, &ss,_data, &stride);
 }
 
 template<> 
-- 
GitLab