aboutsummaryrefslogtreecommitdiff
path: root/src/mathfunc.cpp
diff options
context:
space:
mode:
authorPjotr Prins2017-08-14 07:43:07 +0000
committerPjotr Prins2017-08-14 08:23:14 +0000
commitff1252fe3db1ba639fe148f45b0408a4f182da0d (patch)
treee11ee6858159b53b2570273f9ba3d1ac882232f7 /src/mathfunc.cpp
parent3763f477e17a74942e1bf545aa9493d39bf9448e (diff)
downloadpangemma-ff1252fe3db1ba639fe148f45b0408a4f182da0d.tar.gz
Tests and fixes https://github.com/genetics-statistics/GEMMA/issues/26
Diffstat (limited to 'src/mathfunc.cpp')
-rw-r--r--src/mathfunc.cpp8
1 files changed, 8 insertions, 0 deletions
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;