Add bounds checks to lax

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

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
rust

Research direction

Start by reviewing the LAPACK-calling methods in the lax crate and how they accept layouts and slices. Examine ndarray::ArrayBase conversions and the proposed LapackArrayView and LapackArrayViewMut types. Done means preventing out-of-bounds reads through checked bounds or an explicitly unsafe API.

Written by the indexing model from the issue text.

Description

bug

For the methods in the lax crate which call LAPACK, we need to either add bounds checks (i.e. checking that the provided layout will not cause an out-of-bounds read for the corresponding slice) or make the methods unsafe.

My preference would actually be to change the API, introducing LapackArrayView and LapackArrayViewMut types which combine the layout and slice together into a single type and have checked conversions from ndarray::ArrayBase.

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.