Skip to content

Commit

Permalink
The rref should be called outside the for loop
Browse files Browse the repository at this point in the history
  • Loading branch information
ttadano committed Jun 18, 2018
1 parent ea89378 commit 9936d5d
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions alm/constraint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,12 @@ void Constraint::setup()
// remove_redundant_rows(nparam, const_self[order], eps8);
}


for (it_const = const_translation[order].begin();
it_const != const_translation[order].end(); ++it_const) {
for (i = 0; i < nparam; ++i) arr_tmp[i] = (*it_const).w_const[i];
const_self[order].push_back(ConstraintClass(nparam, arr_tmp));
remove_redundant_rows(nparam, const_self[order], eps8);
}
remove_redundant_rows(nparam, const_self[order], eps8);

if (const_rotation_self[order].size() > 0) {
for (it_const = const_rotation_self[order].begin();
Expand All @@ -222,16 +221,6 @@ void Constraint::setup()
remove_redundant_rows(nparam, const_self[order], eps8);
}

/*
if (const_symmetry[order].size() > 0) {
for (it_const = const_symmetry[order].begin();
it_const != const_symmetry[order].end(); ++it_const) {
for (i = 0; i < nparam; ++i) arr_tmp[i] = (*it_const).w_const[i];
const_self[order].push_back(ConstraintClass(nparam, arr_tmp));
}
remove_redundant_rows(nparam, const_self[order], eps8);
}
*/
memory->deallocate(arr_tmp);
const_translation[order].clear();
const_rotation_self[order].clear();
Expand Down Expand Up @@ -1736,7 +1725,7 @@ void Constraint::rref(int nrows,

if (icol == ncols) break;

if (std::abs(mat[pivot][icol]) > tolerance) ++nrank;
if (std::abs(mat[pivot][icol]) >= tolerance) ++nrank;

if (pivot != irow) {
//#pragma omp parallel for private(tmp)
Expand Down

0 comments on commit 9936d5d

Please sign in to comment.