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.0.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

matmath-2.1.0-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: matmath-2.1.0.tar.gz
  • Upload date:
  • Size: 9.6 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.0.tar.gz
Algorithm Hash digest
SHA256 a3a21df0cc572f2fc80d80f00f313e9f3980a687598f74e8294ed25b919618e0
MD5 6aed541a1ec29980442733830c6c82d9
BLAKE2b-256 14c3b3f5a0541c2abf4e1866f271502b68380e7f108a3e4d289f2f3188abaf5e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: matmath-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.9 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d1395818432a91ccb4fe56ede501c6fa4f41e0665cf8d7503bec146065278d9c
MD5 c62bd577b8f622ce27ef9124a505f46d
BLAKE2b-256 fe815b4615de3bb8da3af46d835528988d6d0f44a9f79e9400bdb855e2c17a8e

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