A lightweight Python module which adds a generalized matrix class, supporting many matrix operations with no external dependencies
Project description
MicroMatrix
This is an old unfinished project which I plan to work on soon.
MicroMatrix is a lightweight Python module which adds a generalized Matrix
class, supporting many matrix operations with no external dependencies.
MicroMatrix Supports:
- Matrices of any size
- Complex Numbers
- Addition & Subtraction
- Multiplication & Division
- Integer Exponentiation
- Transposition
- Inverse & Determinant
- Assignment Operators
- And more!
Usage
Installation
Flask Sitemapper requires Python 3.10 or newer. The latest version can be installed from PyPi with pip as shown below.
pip install micromatrix
Now you can import the Matrix
class to use in your code.
from micromatrix import Matrix
# Creating a 3x2 matrix
my_matrix = Matrix([1, 2, 3], [4, 5, 6])
Supported Operations
MicroMatrix supports many operations, including the standard Python mathematical operators and common matrix operations. These operations can be combined and used for complex calculations.
Keep in mind that some operations may not be possible depending on the dimension and elements of your matrices. In that case, you will see a ValueError
with a description such as:
ValueError: Operation requires a square matrix
Reversible Operations
Matrix + int | float | complex | Matrix -> Matrix
Matrix - int | float | complex | Matrix -> Matrix
Matrix * int | float | complex | Matrix -> Matrix
Matrix / int | float | complex | Matrix -> Matrix
Matrix == Any -> bool
Non-Reversible Operations
Matrix ** int -> Matrix
+ Matrix -> Matrix
- Matrix -> Matrix
~ Matrix -> Matrix
abs(Matrix) -> Matrix
len(Matrix) -> int
str(Matrix) -> str
Properties
Matrix.identity -> Matrix
Matrix.transpose -> Matrix
Matrix.determinant -> int | float | complex
Matrix.invert -> Matrix
Methods
Matrix.administer(func) -> Matrix
applies func to each value in 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
File details
Details for the file micromatrix-1.0.0.tar.gz
.
File metadata
- Download URL: micromatrix-1.0.0.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2316f8530be314aa8fb496ced5cee0a1a7a3c90b6bde8a5c454a92a47ebf9700 |
|
MD5 | 33eb35168f745c954d7ec536e56f7d19 |
|
BLAKE2b-256 | 7786fe46c4d8c9e84c5418623461c129980f2f6af60b5f542e8a4740e74ecc1f |
File details
Details for the file micromatrix-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: micromatrix-1.0.0-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e2b9a44cac077e16df994f697f17a9ca32b41fb34eae952ffb707a60eb7b5ce |
|
MD5 | 48a9a19ab5609033818cdf29a683c1c9 |
|
BLAKE2b-256 | c7e2b288cbfe9b352f5c23d582e650b4ae2af2086a628863c2f4ed91e2fd56b5 |