SolveH uses incorrect triangle

Open
#317 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

Begin by locating the SolveH implementation and its LAPACK call, then run the Rust example from the issue to confirm which triangle is consumed. Done means the SolveH behavior and its documentation agree on the triangle convention, with the example producing the corresponding result.

Written by the indexing model from the issue text.

Description

The documentation for SolveH says "Note that only the upper triangular portion of the matrix is used.". However it actually uses the lower triangular portion. For example:

let a = array![[1.0, 3.0],
               [5.0, 2.0]];
let b = array![29.0, 30.0];
let x = a.solveh(&b).unwrap();
println!("solution = {x:.1}");

prints solution = [4.0, 5.0], which is using the 5.0 off-diagonal element rather than 3.0.

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.