Skip to main content

Simple python package

Project description

re-matrix

This library includes functions for row reducing matrices along with some basic matrix math functions. For example, the following code gets a row reduced version of an example matrix.

from re_matrix import row_reducer

example_matrix = [[8, 2, 3, 4],
                  [5, 3, 7, 8],
                  [7, 9, 2, 5]]
reduced_matrix = row_reducer.get_row_reduced_matrix(example_matrix)
row_reducer.pretty_print_matrix(reduced_matrix)

Here is the output in the console:

------------------
 1.0   0.0  0.0  0.0620915032679738
 0.0   1.0  0.0  0.2908496732026147
-0.0  -0.0  1.0  0.9738562091503268
------------------

You can also get the solutions directly using this code:

import re_matrix

example_matrix = [[8, 2, 3, 4],
                  [5, 3, 7, 8],
                  [7, 9, 2, 5]]
reduced_matrix = re_matrix.get_row_reduced_matrix(example_matrix)
solution_set = re_matrix.get_matrix_solutions(reduced_matrix)
re_matrix.print_solution_set(solution_set)

which produces this output:

the solution set is: 
x_0 = 0.0620915032679738
x_1 = 0.2908496732026147
x_2 = 0.9738562091503268

You can also use the analyze_and_row_reduce_matrix function to see the whole process printed out

import re_matrix

example_matrix = [[8, 2, 3, 4],
                  [5, 3, 7, 8],
                  [7, 9, 2, 5]]
reduced_matrix = re_matrix.analyze_and_row_reduce_matrix(example_matrix)
original matrix:
------------------
8  2  3  4
5  3  7  8
7  9  2  5
------------------
row reduced matrix:
------------------
 1.0   0.0  0.0  0.0620915032679738
 0.0   1.0  0.0  0.2908496732026147
-0.0  -0.0  1.0  0.9738562091503268
------------------
the solution set is: 
x_0 = 0.0620915032679738
x_1 = 0.2908496732026147
x_2 = 0.9738562091503268
The solution set solves the original matrix

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

re_matrix-0.0.9.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

re_matrix-0.0.9-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file re_matrix-0.0.9.tar.gz.

File metadata

  • Download URL: re_matrix-0.0.9.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.11

File hashes

Hashes for re_matrix-0.0.9.tar.gz
Algorithm Hash digest
SHA256 3826db1b01a0055c7978a721b052ce97d28085dec53ced51c4c5349f6c84e410
MD5 14182df06d108dd3f70926706791f1db
BLAKE2b-256 b8a17749b95d02bc7757530f75660a2bd850dce5f5515409bee4f6bd750cf7ad

See more details on using hashes here.

File details

Details for the file re_matrix-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: re_matrix-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.11

File hashes

Hashes for re_matrix-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 baf40699ae64c12c8845a43235f6624121ddd7d9db35c7c7de15b53042ad2c53
MD5 152a4b2580663116cc8754581e659007
BLAKE2b-256 33017ce384b57ad58ea401e3525aaa086c189a1aaf3b3fa81fef39ea9bba7e98

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