Skip to main content

Package to help transform 2-D matrix into reduced row-echelon form.

Project description

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])

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rref-0.3.1.tar.gz (18.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rref-0.3.1-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file rref-0.3.1.tar.gz.

File metadata

  • Download URL: rref-0.3.1.tar.gz
  • Upload date:
  • Size: 18.5 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for rref-0.3.1.tar.gz
Algorithm Hash digest
SHA256 617a220ba417b4659da36386e39df537ca7f7252b90da8efb812b703b845e01c
MD5 4fe2117f66cb854f75c19258215a472c
BLAKE2b-256 0809f8dce5d2264a2e6e91a2dc3bbadb56598cdb316b2599d0fe7d996c84baad

See more details on using hashes here.

File details

Details for the file rref-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: rref-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for rref-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eda4e3f0a7a390a478b239ada19bd1bff04ab24f3609dfe15ee435539c31c7a8
MD5 c355cce6d648a02c95912f337fbb4fe9
BLAKE2b-256 174c48a2d9ac08c770ac7a43afeaa71361303ff35b19efa7b65ce5cb4d8f0b94

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page