Skip to main content

Reduced Row-Echelon Form (RREF) library

This is a simple library for transforming a 2-D matrix to reduced row-echelon form (RREF)1.

Definition2:

In linear algebra, a matrix is in echelon form if it has the shape resulting from a Gaussian elimination.

A matrix being in row echelon form means that Gaussian elimination has operated on the rows, and column echelon form means that Gaussian elimination has operated on the columns. In other words, a matrix is in column echelon form if its transpose is in row echelon form. Therefore, only row echelon forms are considered in the remainder of this article. The similar properties of column echelon form are easily deduced by transposing all the matrices.

A matrix is in reduced row-echelon form if it satisfies the following:

  1. In each row, the left-most nonzero entry is 1 and the column that contains this 1 has all other entries equal to 0. This 1 is called a leading 1.
  2. The leading 1 in the second row or beyond is to the right of the leading 1 in the row just above.
  3. Any row containing only 0's is at the bottom.

Below is a screenshot showing RREF matrices3:

RREF examples


Example Usage

import rref

### Create an uninstanced matrix helper (MatrixMadness)
mm = rref.main.MatrixMadness()

### Create a sample matrix of 20 x 20 with random integers 
### in the range of -5 to 20.
matrix = mm.creatrix(20, [-5, 20])

### Create an RREF instance with your matrix.
r = rref.RREF(matrix)

### Run the processor
# Note: The output matrix will be in the r.mm.matrix variable.
r.run()

### Print the matrix to check results.
result = r.mm.matrix
print([i for i in result])

Metadata

Release files for rref 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rref 0.3.1
File Size Uploaded
rref-0.3.1.tar.gz 18.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rref 0.3.1
File Interpreter ABI Platform
rref-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 30.3 kB

Release files / rref-0.3.1.tar.gz

Download URL rref-0.3.1.tar.gz
Size 18.5 kB
Tags Source
SHA-256 checksum
How to use checksums
617a220ba417b4659da36386e39df537ca7f7252b90da8efb812b703b845e01c
BLAKE2b-256 checksum
How to use checksums
0809f8dce5d2264a2e6e91a2dc3bbadb56598cdb316b2599d0fe7d996c84baad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4

Release files / rref-0.3.1-py3-none-any.whl

Download URL rref-0.3.1-py3-none-any.whl
Size 11.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eda4e3f0a7a390a478b239ada19bd1bff04ab24f3609dfe15ee435539c31c7a8
BLAKE2b-256 checksum
How to use checksums
174c48a2d9ac08c770ac7a43afeaa71361303ff35b19efa7b65ce5cb4d8f0b94
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page