Skip to content

Commit

Permalink
fixed two issues in implementing new sor iteration scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Shaner committed Mar 26, 2016
1 parent 7fcc2ae commit 36db653
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Matrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ int Matrix::getNNZD() {
std::map<int, FP_PRECISION>::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++;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/linalg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down

0 comments on commit 36db653

Please sign in to comment.