about summary refs log tree commit diff
path: root/src/mathfunc.cpp
diff options
context:
space:
mode:
authorPjotr Prins2017-10-13 12:28:26 +0000
committerPjotr Prins2017-10-13 15:27:24 +0000
commita610dd723a233aed1abe31aa32e3137b23b5f983 (patch)
tree66172cf10d0d85f5a61219c1b7b074cbadb45575 /src/mathfunc.cpp
parent25ad9756ebecfdb2f01b6f87c35bd731e3a3186d (diff)
downloadpangemma-a610dd723a233aed1abe31aa32e3137b23b5f983.tar.gz
OpenBlas: preparing for dgemm use
Diffstat (limited to 'src/mathfunc.cpp')
-rw-r--r--src/mathfunc.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mathfunc.cpp b/src/mathfunc.cpp
index 4203837..fbbc061 100644
--- a/src/mathfunc.cpp
+++ b/src/mathfunc.cpp
@@ -313,6 +313,13 @@ bool isMatrixIllConditioned(const gsl_vector *eigenvalues, double max_ratio) {
   return ret_valid;
 }
 
+double sum(const double *m, size_t rows, size_t cols) {
+  double sum = 0.0;
+  for (auto i = 0; i<rows*cols; i++)
+    sum += m[i];
+  return sum;
+}
+
 double SumVector(const gsl_vector *v) {
   double sum = 0;
   for (int i = 0; i < v->size; i++ ) {