aboutsummaryrefslogtreecommitdiff
path: root/src/mathfunc.cpp
diff options
context:
space:
mode:
authorPeter Carbonetto2017-08-14 21:50:00 -0500
committerGitHub2017-08-14 21:50:00 -0500
commita6eca6837cf1eedb3a660dd434b05389c3ec4e95 (patch)
treee11ee6858159b53b2570273f9ba3d1ac882232f7 /src/mathfunc.cpp
parent3763f477e17a74942e1bf545aa9493d39bf9448e (diff)
parentff1252fe3db1ba639fe148f45b0408a4f182da0d (diff)
downloadpangemma-a6eca6837cf1eedb3a660dd434b05389c3ec4e95.tar.gz
Merge pull request #68 from genenetwork/issue26.
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;