Skip to main content

A small Python module which adds a generalized matrix class, supporting many operations with no external dependencies

Project description

MicroMatrix

This is an old unfinished project which I plan to work on soon.

MicroMatrix is a small Python module which adds a generalized Matrix class, supporting many 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])

Matrix 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 - int | float | complex | Matrix
  • Matrix * int | float | complex | Matrix
  • Matrix / int | float | complex | Matrix
  • Matrix == Any

Non-Reversible Operations

  • Matrix ** int
  • + Matrix
  • - Matrix
  • ~ Matrix
  • abs(Matrix)
  • len(Matrix)
  • str(Matrix)

Properties

  • Matrix.identity
  • Matrix.transpose
  • Matrix.determinant
  • Matrix.invert

Methods

  • Matrix.administer(function)

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

micromatrix-1.0.0a1.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

micromatrix-1.0.0a1-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file micromatrix-1.0.0a1.tar.gz.

File metadata

  • Download URL: micromatrix-1.0.0a1.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for micromatrix-1.0.0a1.tar.gz
Algorithm Hash digest
SHA256 75f6524b257a72910c60c177959d693c1813755ba79679b2f5ed06c93d9136da
MD5 c132231c9d1ee52dd1b7c1a06baab38a
BLAKE2b-256 4bf7a67d9de14a6a030dea00e8ca46b2ca341433ba999a476f963194a7014250

See more details on using hashes here.

File details

Details for the file micromatrix-1.0.0a1-py3-none-any.whl.

File metadata

File hashes

Hashes for micromatrix-1.0.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 5425c04dd7f938bf0e593e374209f406346b4d66a55fdd48df4b877fc7a85b83
MD5 f8abc95612b062722488e4d0289262e4
BLAKE2b-256 407f58ed2b806a139e4b9c384ec0f0bd6ae5c1a8c089ecf9ac0156d6321fda1b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page