Skip to content

Commit

Permalink
fixed files form Math #86
Browse files Browse the repository at this point in the history
  • Loading branch information
tdurieux committed Mar 7, 2017
1 parent 9430360 commit ab95bbc
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,6 @@ public CholeskyDecompositionImpl(final RealMatrix matrix,

final double[] lI = lTData[i];

if (lTData[i][i] < absolutePositivityThreshold) {
throw new NotPositiveDefiniteMatrixException();
}
// check off-diagonal elements (and reset them to 0)
for (int j = i + 1; j < order; ++j) {
final double[] lJ = lTData[j];
Expand All @@ -134,6 +131,9 @@ public CholeskyDecompositionImpl(final RealMatrix matrix,
final double[] ltI = lTData[i];

// check diagonal element
if (ltI[i] < absolutePositivityThreshold) {
throw new NotPositiveDefiniteMatrixException();
}

ltI[i] = Math.sqrt(ltI[i]);
final double inverse = 1.0 / ltI[i];
Expand Down

0 comments on commit ab95bbc

Please sign in to comment.