From ff1252fe3db1ba639fe148f45b0408a4f182da0d Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Mon, 14 Aug 2017 07:43:07 +0000 Subject: Tests and fixes https://github.com/genetics-statistics/GEMMA/issues/26 --- src/mathfunc.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/mathfunc.cpp') diff --git a/src/mathfunc.cpp b/src/mathfunc.cpp index 9e19bf1..9a4bb8b 100644 --- a/src/mathfunc.cpp +++ b/src/mathfunc.cpp @@ -187,6 +187,14 @@ double ScaleMatrix(gsl_matrix *G) { return d; } +double SumVector(const gsl_vector *v) { + double sum = 0; + for (int i = 0; i < v->size; i++ ) { + sum += gsl_vector_get(v, i); + } + return( sum ); +} + // Center the vector y. double CenterVector(gsl_vector *y) { double d = 0.0; -- cgit v1.2.3