Skip to content

Commit

Permalink
More efficient Nudge in Process
Browse files Browse the repository at this point in the history
  • Loading branch information
vgnecula committed Jun 24, 2024
1 parent 95ee8e1 commit 23077f6
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,13 +241,16 @@ private :
{
MT A = P.get_mat();
VT b = P.get_vec();

int m = A.rows();
const NT* b_data = b.data();

VT b_Ax = b - A * p.getCoefficients();
const NT* b_Ax_data = b_Ax.data();

NT dist;

for (int i = 0; i < m; i++) {

NT dist = *b_data - A.row(i) * p.getCoefficients();
dist = *b_Ax_data;

if (dist < NT(-tol)){
//Nudging correction
Expand All @@ -263,7 +266,7 @@ private :
shift.operator*=(eps_2);
p.operator+=(shift);
}
b_data++;
b_Ax_data++;
}
}

Expand Down

0 comments on commit 23077f6

Please sign in to comment.