From 36db653adaed154ec7b4fc879ca5b67389f0b1d3 Mon Sep 17 00:00:00 2001 From: Sam Shaner Date: Sat, 26 Mar 2016 15:34:16 -0400 Subject: [PATCH] fixed two issues in implementing new sor iteration scheme --- src/Matrix.cpp | 2 +- src/linalg.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Matrix.cpp b/src/Matrix.cpp index 947a20940..09e5efeb3 100644 --- a/src/Matrix.cpp +++ b/src/Matrix.cpp @@ -474,7 +474,7 @@ int Matrix::getNNZD() { std::map::iterator iter; for (int row=0; row < _num_rows; row++) { for (iter = _LIL[row].begin(); iter != _LIL[row].end(); ++iter) { - if (iter->second != 0.0 || iter->first != row) + if (iter->second != 0.0 && iter->first != row) NNZD++; } } diff --git a/src/linalg.cpp b/src/linalg.cpp index 783c6105a..9c64c00e6 100644 --- a/src/linalg.cpp +++ b/src/linalg.cpp @@ -159,7 +159,7 @@ void linearSolve(Matrix* A, Matrix* M, Vector* X, Vector* B, FP_PRECISION tol, /* Perform parallel red/black SOR iteration */ for (int color=0; color < 2; color++) { -#pragma omp parallel for private(row) +#pragma omp parallel for private(row, val) for (int yc=0; yc < num_y; yc++) { for (int xc=(yc + color) % 2; xc < num_x; xc+=2) { for (int g=0; g < num_groups; g++) {