Example failing on mac os

Open
#293 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
rust
Domain
data

Research direction

Reproduce the test from the issue using the shown Cargo.toml dependencies and the solve_into entry point on macOS. Inspect the OpenBLAS backend configuration and the ndarray-linalg solve path to determine whether the incorrect result is backend-specific. Done means identifying the cause and adding or updating a regression test for the expected solution.

Written by the indexing model from the issue text.

Description

I'm having an issue getting the crate to work reliably on OSX. My product requires some simple linear algebra, using the solve functions. My Cargo.toml looks like this

[dependencies]
ndarray = { version = "0.14" }
num-complex = { version = "0.3.1" }
ndarray-linalg = { version = "0.13.1", features=["openblas"] }

and I am trying to run a simple test I lifted the examples in the crate docs

#[test]
fn test_mat_mul() {
    use ndarray::prelude::*;
    use ndarray_linalg::Solve;

    let a: Array2<f64> = array![[3., 2., -1.], [2., -2., 4.], [-2., 1., -2.]];
    let b: Array1<f64> = array![1., -2., 0.];
    let x = a.solve_into(b).unwrap();
    assert!(x.all_close(&array![1., -2., -2.], 1e-9));
}

which I would expect to pass fine. Instead it finds x = [1.0, 1.2000000000000002, -0.40000000000000013].

Any ideas? Is this a problem with using the openblas backend on osx?

Dominant language
Rust
Stars
452
Forks
95
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rust-ndarray/ndarray-linalg

All issues in rust-ndarray/ndarray-linalg

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.