diff options
-rw-r--r-- | dist.cpp | 1 | ||||
-rw-r--r-- | projectionobserver.cpp | 1 |
2 files changed, 2 insertions, 0 deletions
@@ -10,6 +10,7 @@ arma::mat mp::dist(const arma::mat &X, mp::DistFunc dfunc) arma::uword n = X.n_rows; arma::mat D(n, n, arma::fill::zeros); + #pragma omp parallel for shared(X, D) for (arma::uword i = 0; i < n; i++) { for (arma::uword j = 0; j < i; j++) { D(i, j) = dfunc(X.row(i), X.row(j)); diff --git a/projectionobserver.cpp b/projectionobserver.cpp index 33869a8..781aba9 100644 --- a/projectionobserver.cpp +++ b/projectionobserver.cpp @@ -9,6 +9,7 @@ static void aggregatedError(const arma::mat &distX, const arma::mat &distY, arma double maxX = distX.max(); double maxY = distY.max(); + #pragma omp parallel for shared(maxX, maxY, distX, distY, v) for (arma::uword i = 0; i < v.n_elem; i++) { v[i] = 0; for (arma::uword j = 0; j < v.n_elem; j++) { |