From dd525f680f0b149e7099218375cd8d5876d9d629 Mon Sep 17 00:00:00 2001 From: Bruno Seny <bruno.seny@student.uclouvain.be> Date: Tue, 24 Nov 2009 10:47:11 +0000 Subject: [PATCH] new add+scale function --- Numeric/fullMatrix.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Numeric/fullMatrix.h b/Numeric/fullMatrix.h index 427a9b5321..bc829bd231 100644 --- a/Numeric/fullMatrix.h +++ b/Numeric/fullMatrix.h @@ -181,6 +181,14 @@ class fullMatrix for(int j = 0; j < size2(); j++) (*this)(i, j) += m(i, j); } + +inline void add(const fullMatrix<scalar> &m, const double &a) + { + for(int i = 0; i < size1(); i++) + for(int j = 0; j < size2(); j++) + (*this)(i, j) += a*m(i, j); + } + void mult(const fullVector<scalar> &x, fullVector<scalar> &y) #if !defined(HAVE_BLAS) { -- GitLab