Skip to content

Commit 8988eff

Browse files
authored
Merge pull request #89 from jturner314/fill-lower-invh
Fill lower triangular portion of invh*() output
2 parents 61fe479 + dd31e40 commit 8988eff

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

src/solveh.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -177,23 +177,13 @@ where
177177
pub trait InverseH {
178178
type Output;
179179
/// Computes the inverse of the Hermitian (or real symmetric) matrix.
180-
///
181-
/// **Warning: The inverse is stored only in the upper triangular portion
182-
/// of the result matrix!** If you want the lower triangular portion to be
183-
/// correct, you must fill it in according to the results in the upper
184-
/// triangular portion.
185180
fn invh(&self) -> Result<Self::Output>;
186181
}
187182

188183
/// An interface for inverting Hermitian (or real symmetric) matrices.
189184
pub trait InverseHInto {
190185
type Output;
191186
/// Computes the inverse of the Hermitian (or real symmetric) matrix.
192-
///
193-
/// **Warning: The inverse is stored only in the upper triangular portion
194-
/// of the result matrix!** If you want the lower triangular portion to be
195-
/// correct, you must fill it in according to the results in the upper
196-
/// triangular portion.
197187
fn invh_into(self) -> Result<Self::Output>;
198188
}
199189

@@ -213,6 +203,7 @@ where
213203
&self.ipiv,
214204
)?
215205
};
206+
triangular_fill_hermitian(&mut self.a, UPLO::Upper);
216207
Ok(self.a)
217208
}
218209
}

0 commit comments

Comments
 (0)