aboutsummaryrefslogtreecommitdiff
path: root/forceScheme.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'forceScheme.cpp')
-rw-r--r--forceScheme.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/forceScheme.cpp b/forceScheme.cpp
index de856ba..0dc7e34 100644
--- a/forceScheme.cpp
+++ b/forceScheme.cpp
@@ -3,6 +3,8 @@
#include <algorithm>
#include <vector>
+static const double EPSILON = 1e-3;
+
typedef arma::uvec V;
arma::mat mp::forceScheme(const arma::mat &D,
@@ -28,7 +30,7 @@ arma::mat mp::forceScheme(const arma::mat &D,
continue;
arma::rowvec direction(Y.row(*b) - Y.row(*a));
- double d2 = std::max(arma::norm(direction, 2), mp::EPSILON);
+ double d2 = std::max(arma::norm(direction, 2), EPSILON);
double delta = (D(*a, *b) - d2) / fraction;
deltaSum += fabs(delta);
Y.row(*b) += delta * (direction / d2);