Skip to main content

A simple and efficient module for matrix manipulation.

Project description

matmath module

A simple and efficient module for matrix manipulation.


Installing under Python

When installing the matmath module for python, it is recommended that you check if you have python 3.6 or above. To install matmath, goto a terminal and run:

pip3 install matmath

Functions and their uses

Matrix related functions

Functions Description
adj Returns the adjoint of the matrix multiplied by the multiplication factor.
compatAS Tells if the addition/subtractition of the matrices is mathematically possible.
compatM Tells if the multiplication of the matrices is mathematically possible.
cut Returns a smaller matrix by removing the required row and column. The default of row and column is 0.
det Returns the determinant of the matrix (if mathematically possible).
Identity Returns an identity matrix of order N x N multiplied by the multiplication factor.
inv Returns the inverse of the matrix (if mathematically possible) multiplied by the multiplication factor.
isDiagonal Tells if input is a diagonal matrix.
isIdentity Tells if input is an identity matrix.
isLTriangular Tells if input is a lower triangular matrix.
isMatrix Tells if input is actually a matrix.
isNull Tells if input is a null matrix.
isSkewSymmetric Tells if input is a skew symmetric matrix.
isSquare Tells if input is a square matrix.
isSymmetric Tells if input is a symmetric matrix.
isUTriangular Tells if input is an upper triangular matrix.
matAdd Returns the sum matrix (i.e. A + B), if mathematically possible.
matMul Returns the product matrix (i.e. AB), if mathematically possible.
matSub Returns the difference matrix (i.e. A - B), if mathematically possible.
Null Returns a null matrix of order N x M. If only 1 parameter is given returns a null matrix of order N x N.
order Returns the order of the matrix as a tuple of the form (rows, columns).
power Returns the nth power of matrix A, if mathematically possible.
rotate Returns a matrix which is formed by rotating the given matrix, n times, in clockwise sense.
scalarMul Returns the scalar product of A and n (i.e. nA).
trace Returns the trace of the matrix (i.e the product of elements on the diagonal), if mathematically possible.
transpose Returns the transpose of the matrix.

NOTE: Default value of mul (multiplication factor) is always 1.

Vector related functions

Functions Description
__add__ Adds the 2 vectors
__eq__ Tells whether the 2 vectors are equal or not.
getitem__ Returns the vector at the given index.
__len__ Returns the length of the vector.
__mul__ Alias of cross_product().
__setitem__ changes the value of the vector using the key.
__sub__ Subtracts the second vector from the first vector.
argument Returns the argument of the vector.
cross_product Cross product of the vector with respect to another vector.
dot_product Dot product of the vector with respect to another vector.
is_parellel Tells whether the two vectors are parellel or not.
is_unit Tells whether the vector is a unit vector or not.
magnify Magnifies a vector.
modulus Returns the modulus of the vector.
rotate Rotates the 2d vector in 2D space.
unitVector Returns the unit vector in the direction of the vector.
S

Contact

Please feel free to reach out if you have any questions:


License

MIT License

Copyright (c) 2021 Siddhesh-Agarwal

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

matmath-2.1.1.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

matmath-2.1.1-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file matmath-2.1.1.tar.gz.

File metadata

  • Download URL: matmath-2.1.1.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.8

File hashes

Hashes for matmath-2.1.1.tar.gz
Algorithm Hash digest
SHA256 e92d0a99b35cc543b6939880780dc1e54b8c78916afe8be12aab4bad7833be2e
MD5 1803da0e5b286d83fe41f4a831fef230
BLAKE2b-256 696d7eb39b12f29b12d13b3b716f436862f227cd073ce3f72743f61c4d57a829

See more details on using hashes here.

File details

Details for the file matmath-2.1.1-py3-none-any.whl.

File metadata

  • Download URL: matmath-2.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.8

File hashes

Hashes for matmath-2.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 101848c9deb4f35db0e86a689d8d9ecce3f5621860a43b57760f783600b7b661
MD5 883bd02d04647168192d5736127d5677
BLAKE2b-256 f424947b4533424dc379aea5708b2f62af1b1981b79a6d6cd344b590eee7da42

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