A library that deals with matrix and vector operations.
Project description
Matrixlib
NOTICE
"rank" and "inverse" functions are a work in progress, they DO NOT WORK.
A basic library for matrix and vector operations. Any feedback is highly encouraged. I enjoy trying to create modules and programs that work with mathematical functions and data. I also like looking into higher end modules and researching the processes and programs they use to perform tasks. Any feedback will be taken and acted upon.
Installation
Use the package manager pip to install matrixlib_jfj.
Release Versions:
pip install matrixlib_jfj
Test Versions:
pip install -i https://test.pypi.org/simple matrixlib-jfj
General Usage
import matrixlib_jfj as ml
# matrix = ml.matrix.Matrix(rowcols=(x, y) or values=[[nested list(s) with values assigned]]) Initialises the matrix.
Example:
matrix = ml.matrix.Matrix(rowcols=(3, 3))
>>> [[0, 0, 0], [0, 0, 0], [0, 0, 0]]
print(matrix)
+- -+
| 0 0 0 |
>>> | 0 0 0 |
| 0 0 0 |
+- -+
# matrix.random(a, b) Adds random values to the entire matrix
Example:
matrix.random(1, 10)
+- -+
|7 10 7 |
>>> |1 1 7 |
|10 5 8 |
+- -+
# matrix.identity() Creates an identity matrix from an existing square matrix
+- -+
|1 0 0|
>>> |0 1 0|
|0 0 1|
+- -+
### Adding ###
matrix1 = ml.matrix.Matrix(values=[
[1, 2, 3],
[4, 5, 6],
[7, 8, 9]
])
matrix2 = ml.matrix.Matrix(values=[
[9, 8, 7],
[6, 5, 4],
[3, 2, 1]
])
+- -+
|10 10 10|
>>> |10 10 10|
|10 10 10|
+- -+
Updates
Update 0.0.7
Added "get_submatrix" function that gets the submatrix of any square matrix, added the "det" function which gets the determinant of a square matrix.
Update 0.0.8
Fixed bug where an external program would run when the user of the package would run their own program.
Update 0.0.81
Updated README file to reflect certain information.
Update 0.0.82
Fixed Type Annotations.
Update 0.1.82
Removed Deprecations, Removed functionality in utils.py (Temporary) added better typing, improved cumsum function.
Update 0.1.90
Added temporary base case to Matrix.rank() function.
Contributing
Any and All feedback and help is highly encouraged. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
License
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
Hashes for matrixlib_jfj-0.2.5-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a16c8f251db1b3942b05d9aa8944ce970aa376da5eec0aa1fb5df13b6b97edf6 |
|
MD5 | 2b3206ca73f3021261353618ed7dd728 |
|
BLAKE2b-256 | 64756236692fbba93306d05370ed2bfee33ea81301241f54e71eee1d84e63a58 |