Matrix operations and linear algebra (mola) library without external dependencies
Project description
Matrix operations and linear algebra (mola) library for vanilla Python
Introduction
mola is a Python library for doing algebra with matrices. It covers the basic operations such as matrix addition and multiplication, transposes, and inverse. It is written without any external Python libraries.
I wrote mola as a hobby project to remind myself of the linear algebra I studied in uni and to practice my Python programming. Particularly, this is an exercise in publishing my first Python library.
The documentation will likely improve after I learn to leverage docstrings properly.
Getting started
WIP
Prerequisites
- Python 3.x (written on Python 3.9, so that's sure to work)
Classes
Matrix
Matrix is the main class of mola. In practice, the elements of the matrix are implemented with lists. Most of its functionality involves calling methods from this class. However, for a more user-friendly approach, I plan on implementing some wrapper functions you can call directly (e.g., "linear_least_squares()" to perform linear regression).
TODO:
- checks to see if matrix is positive/negative definite/semidefinite
- different matrix norms (only Frobenius norm implemented right now)
- class wrapping generalized least squares in an approachable interface
- Gauss-Newton iteration
- Levenberg-Marquardt algorithm
- regularized least squares
- simple decompositions
- support for complex numbers
License
MIT License
Copyright (c) 2023 Jere Lavikainen
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
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 mola-0.1.0.tar.gz
.
File metadata
- Download URL: mola-0.1.0.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49666a62ad0b325f5cb74c8c31b9caf5a2d7251f005456957aaf3cf443485b59 |
|
MD5 | 13b4070e62fb9efa907e17fb6b0ad6fb |
|
BLAKE2b-256 | ee76e0f4fa4df29f4bb8d1b101e14a79edb0e7183fb025e41aee60fae396f57f |
File details
Details for the file mola-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: mola-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.5 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 | c71d7b2527a63bd89a6e86f93027b2eefd95abfe833bd66701c16925b944b3e8 |
|
MD5 | 132e0f22b238244196b8816a4093c09a |
|
BLAKE2b-256 | d72145c4624bd03f1318c8f065575c3b676209ef3a00049ade2b91b8dd326a26 |