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 ea91231 commit 9ccb6afCopy full SHA for 9ccb6af
ndarray-linalg/src/solveh.rs
@@ -314,6 +314,7 @@ where
314
S: Data<Elem = A>,
315
A: Scalar + Lapack,
316
{
317
+ let layout = a.layout().unwrap();
318
let mut sign = A::Real::one();
319
let mut ln_det = A::Real::zero();
320
let mut ipiv_enum = ipiv_iter.enumerate();
@@ -337,9 +338,15 @@ where
337
338
debug_assert_eq!(lower_diag.im(), Zero::zero());
339
340
// Off-diagonal elements, can be complex.
- let off_diag = match uplo {
341
- UPLO::Upper => unsafe { a.uget((k, k + 1)) },
342
- UPLO::Lower => unsafe { a.uget((k + 1, k)) },
+ let off_diag = match layout {
+ MatrixLayout::C { .. } => match uplo {
343
+ UPLO::Upper => unsafe { a.uget((k + 1, k)) },
344
+ UPLO::Lower => unsafe { a.uget((k, k + 1)) },
345
+ },
346
+ MatrixLayout::F { .. } => match uplo {
347
+ UPLO::Upper => unsafe { a.uget((k, k + 1)) },
348
+ UPLO::Lower => unsafe { a.uget((k + 1, k)) },
349
350
};
351
352
// Determinant of 2x2 block.
0 commit comments