Fixed axis length support similiar to `Eigen`

Open
#1,136 2 comments 1 reaction 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
Needs clarification
Activity status
Stale
Tech stack
rust
Domain
data, performance

Research direction

Start by reviewing the Dimension and ArrayRepr traits, including the possible Data refactor, and the FixedIx2 design described in the issue. Check the constraints around const_evaluatable_checked, specialization, and mixing fixed and dynamic axes; done would require an agreed design and implementation plan for fixed axis lengths.

Written by the indexing model from the issue text.

Description

In Eigen, We can write Matrix<float, 4, 4> to represent a matrix with fixed 4x4 size. In Rust, I would imaging syntax similar to ArrayBase<Array2Repr<T, 4, 4>, FixedIx2<4, 4>>, which has no allocation, const bound check and enable better simd instructions.

I can see several difficulty implementing this:

  1. Dimension trait currently requires Add/Sub/Mul, which doesn't make sense in fixed length.
  2. ArrayRepr requires exact generic argument match to FixedIx2. This might requires refactor to Data or Dimension traits.
  3. Enable better simd instructions on specific axis length might require #[feature(const_evaluatable_checked)] and #[feature(specialization)], and both of them are incomplete feature.
  4. Mixing fixed axis length and dynamic axis length in one matrix seems hard.
Dominant language
Rust
Stars
4.3k
Forks
391
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

All issues in rust-ndarray/ndarray

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.