Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibly a bug in linear solve with column major layout? #228

Closed
cxzheng opened this issue Jul 19, 2020 · 1 comment · Fixed by #240
Closed

Possibly a bug in linear solve with column major layout? #228

cxzheng opened this issue Jul 19, 2020 · 1 comment · Fixed by #240
Labels
bug Bug issue, or bug fix change

Comments

@cxzheng
Copy link

cxzheng commented Jul 19, 2020

Hi, I'm trying to use the package, but found something very puzzling.

The following code from the example in the doc works perfectly:

let a: Array2<f64> = random((3, 3));
let f = a.factorize_into().unwrap(); // LU factorize A (A is consumed)
for _ in 0..3 {
    let b: Array1<f64> = random(3);
    let x = f.solve_into(b).unwrap(); // Solve A * x = b using factorized L, U
}

However, as soon as I change the layout into column (F) major, the code panics:

    let a: Array2<f64> = random((3, 3).f());
    let f = a.factorize_into().unwrap(); // LU factorize A (A is consumed)
    for _ in 0..3 {
        let b: Array1<f64> = random(3);
        let x = f.solve_into(b).unwrap(); // Solve A * x = b using factorized L, U
        println!("x = {:?}", x);
    }

Here the only change is the layout of a (from row major into column major).

Can anyone provide some help if this is a bug or something I didn't fully understand?

@termoshtt
Copy link
Member

Thanks reporting!

I confirmed it and it should be a bug

@termoshtt termoshtt added the bug Bug issue, or bug fix change label Jul 20, 2020
@termoshtt termoshtt modified the milestone: 0.12.2 Jul 23, 2020
termoshtt added a commit that referenced this issue Jul 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug issue, or bug fix change
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants