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 ef8482f commit 15b4a51Copy full SHA for 15b4a51
ndarray-linalg/src/solve.rs
@@ -323,8 +323,15 @@ where
323
type Output = Array2<A>;
324
325
fn inv(&self) -> Result<Array2<A>> {
326
+ // Preserve the existing layout. This is required to obtain the correct
327
+ // result, because the result of `A::inv` is layout-dependent.
328
+ let a = if self.a.is_standard_layout() {
329
+ replicate(&self.a)
330
+ } else {
331
+ replicate(&self.a.t()).reversed_axes()
332
+ };
333
let f = LUFactorized {
- a: replicate(&self.a),
334
+ a,
335
ipiv: self.ipiv.clone(),
336
};
337
f.inv_into()
0 commit comments