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.

#Installation:

pip install re-matrix

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.1.0.tar.gz (4.3 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.1.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: re_matrix-0.1.0.tar.gz
  • Upload date:
  • Size: 4.3 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.1.0.tar.gz
Algorithm Hash digest
SHA256 10759368e51ef96e930d09e0b7d21d1508be603b0cf1385816e1d8f5860cf35f
MD5 8516c766fe692f136b52ccffbb73e2cd
BLAKE2b-256 06c08d8de7dc94f1769f7e8ed0364dd5262886242dba7353f9824fc7be733713

See more details on using hashes here.

File details

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

File metadata

  • Download URL: re_matrix-0.1.0-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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 df593743ad96d5b1d06b52590f72304385c9ce1d3febe9c5e623ef0612dee0b2
MD5 c96a5846a89dbe6f0bad38b4161c4b12
BLAKE2b-256 58d15335dd8da9726a235ace96df896c0dc47d14e80dd157abff9243c0ca31e9

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