We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ac5582a commit 80ea94cCopy full SHA for 80ea94c
1 file changed
core/src/linalg.rs
@@ -124,7 +124,7 @@ fn eigenvalue_pass(matrix: &DMatrix<f64>) -> Option<DMatrix<f64>> {
124
125
// Create diagonal matrix of sqrt(eigenvalues), clamping eigenvalues to be non-negative.
126
// `DMatrix::from_diagonal` takes a DVector.
127
- let sqrt_eigenvalues_diag_vec = eigenvalues.map(|val| val.max(0.0).sqrt());
+ let sqrt_eigenvalues_diag_vec = eigenvalues.map(|val| val.max(1e-9).sqrt());
128
let sqrt_eigenvalues_diag = DMatrix::from_diagonal(&sqrt_eigenvalues_diag_vec);
129
130
// Reconstruct the square root: S = V * sqrt(D) * V^T
0 commit comments