ruby / ruby/matrix

Feature request: Reduced Row Echelon Form

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

Nobody has claimed this yet.

Dominant language
Ruby
Stars
92
Forks
26
PR merge metrics
No merged PRs in 30d

Description

Reduced Row Ecehelon form is a common linear algebra expression that I was surprised was not included in the Matrix gem already. I came upon the need for it while solving today's Advent of Code problem.

Proposed use:

matrix = Matrix[
  [94, 22, 8400],
  [34, 67, 5400]
]

matrix.rref # =>
[ 
  [1, 0, 80],
  [0, 1, 40]
]

Edge cases:

  • Infinite/multiple solutions
  • No solution
  • Invalid Matrixes containing non-numbers

Before we put in the efforts to add this instance method, I'm wondering if this is something worth adding and how we would want to handle the outputs of the edge cases.

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.

Research direction

Review the Matrix gem's existing API and the linked reduced row echelon form definition. Decide how rref should represent infinite or multiple solutions, no solution, and matrices containing non-numbers, then validate the proposed example and document the chosen behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.