Skip to content

Commit

Permalink
Use logical instead of bitwise and
Browse files Browse the repository at this point in the history
  • Loading branch information
rotu committed Oct 14, 2024
1 parent b050add commit 5812503
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dc/cholesky.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ export default class CholeskyDecomposition {

d = a.get(j, j) - d;

positiveDefinite &= d > 0;
positiveDefinite &&= d > 0;
l.set(j, j, Math.sqrt(Math.max(d, 0)));
for (k = j + 1; k < dimension; k++) {
l.set(j, k, 0);
}
}

this.L = l;
this.positiveDefinite = Boolean(positiveDefinite);
this.positiveDefinite = positiveDefinite;
}

isPositiveDefinite() {
Expand Down

0 comments on commit 5812503

Please sign in to comment.