Simple python package
Project description
re-matrix
This library row includes functions for row reducing matrices along with some basic matrix math functions. For example, the following code reduces 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
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file re_matrix-0.0.8.tar.gz.
File metadata
- Download URL: re_matrix-0.0.8.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2dba544f3b1a70784eff7d2ff6bbd55e11bd2063b051b2ed89483dbed561552b
|
|
| MD5 |
6ba8360e0fcec747add203f3da2fcb84
|
|
| BLAKE2b-256 |
9b4e0c01f3b33ed6de7e809f8ef8f7b5f12b3da21fd26427c872340a14d3a6ce
|
File details
Details for the file re_matrix-0.0.8-py3-none-any.whl.
File metadata
- Download URL: re_matrix-0.0.8-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f7d96da6cb3465a3c0051ce5b115681c9afbab1d3aae0ade6bc3718160a033bf
|
|
| MD5 |
432b7dfd82dcc0577e3156602f57a28a
|
|
| BLAKE2b-256 |
74f5acca4985977a3aa6ca59390b98db742ed58f4c464babe6db56d575d1d600
|