aboutsummaryrefslogtreecommitdiff
path: root/src/mathfunc.cpp
diff options
context:
space:
mode:
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;