Skip to content

Commit

Permalink
add dangle limit
Browse files Browse the repository at this point in the history
  • Loading branch information
oguyon committed Feb 18, 2024
1 parent ecc250f commit 325dd7e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions plugins/milk-extra-src/linalgebra/basis_rotate_match.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ errno_t compute_basis_rotate_match(

double alphap = 1.0;
double dangle = 1.0;
double danglemin = 0.0001;
double posSideAmp = 10.0;

// temp storate for vects to be swapped
Expand All @@ -333,7 +334,7 @@ errno_t compute_basis_rotate_match(
}


while ( loopiter < loopiterMax )
while ( ( loopiter < loopiterMax ) && ( dangle > danglemin) )
{
long cntpos = 0;
long cntneg = 0;
Expand All @@ -355,7 +356,7 @@ errno_t compute_basis_rotate_match(
optall += dcoeff * matAB[iia*Bdim + iib] * dcoeff * matAB[iia*Bdim + iib];
}
}
printf("iter %4d / %4d dangle = %f val = %g\n", loopiter, loopiterMax, dangle, optall);
printf("iter %4d / %4d dangle = %f / %f val = %g\n", loopiter, loopiterMax, dangle, danglemin, optall);

for ( int n0 = 0; n0 < Adim; n0++)
{
Expand Down

0 comments on commit 325dd7e

Please sign in to comment.