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 the library:

pip install matmath

Functions and their uses

Matrix related functions

Functions Description
adj Returns the adjoint of the matrix multiplied by the multiplication factor. Default value of mul(multiplication factor) is 1.
compatAS Returns True if matrices are compatible for addition/subtraction else returns False.
compatM Returns True if matrices are compatible for multiplication else returns False.
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 (iff the matrices are compatible for multiplication) multiplied by the multiplication factor. Default value of mul (multiplication factor) is 1.
Identity Returns an identity matrix of order N x N multiplied by the multiplication factor. Default value of mul (multiplication factor) is 1.
inv Returns the inverse of the matrix (iff the matrices are compatible) multiplied by the multiplication factor. Default value of mul (multiplication factor) is 1.
isDiagonal Returns True if matrix is a diagonal matrix else returns False.
isIdentity Returns True if matrix is an identity matrix else returns False.
isLTriangular Returns True if matrix is a lower triangular matrix else returns False.
isMatrix Returns True if matrix is a valid matrix else returns False.
isNull Returns True if matrix is a null matrix else returns False.
isSkewSymmetric Returns True if matrix is a skew symmetric matrix else returns False.
isSquare Returns True if matrix is a square matrix else returns False.
isSymmetric Returns True if matrix is a symmetric matrix else returns False.
isUTriangular Returns True if matrix is an upper triangular matrix else returns False.
matAdd Returns the sum matrix (i.e. A + B), provided the matrices are compatible.
matMul Returns the product matrix (i.e. AB), provided the matrices are compatible.
matSub Returns the difference matrix (i.e. A - B), provided the matrices are compatible.
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 matrix representing the nth power of matrix A, provided the matrix is square matrix.
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 possible.
transpose Returns the transpose of the matrix.

Vector related functions

Functions Description
modulus Returns the modulus of the vector.
argument Returns the argument of the vector.
unitVector Returns the unit vector in the direction of the vector.
magnify Returns a magnified vector.
rotate Rotates the 2d vector in 2D space.
dot_product Dot product of the vector with respect to another vector.
cross_product Cross product of the vector with respect to another vector.
add Adds the 2 vectors
sub Subtracts the second vector from the first vector.
mul Alias of cross_product.

Upcoming

Increased speed of Matrix operations by using 2D Numpy Array instead of list of lists.


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

Uploaded Source

Built Distribution

matmath-2.0.0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: matmath-2.0.0.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.6.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.9.1

File hashes

Hashes for matmath-2.0.0.tar.gz
Algorithm Hash digest
SHA256 f9f7913d0a5a62625915e6ac14369cd9324d6bb29f86a55915d24bd8e6cf41bf
MD5 bf94cafd9b375ebc134c73ea836d60c8
BLAKE2b-256 b2ea84821e5d8d6f1c124b2ce66e43abbc0e0d506e28b2f23b7eba9166b50952

See more details on using hashes here.

File details

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

File metadata

  • Download URL: matmath-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.6.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.9.1

File hashes

Hashes for matmath-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 101248db2635040ad48b614f13b8b8c83ceca562eeb7fd9d350b5346251f277e
MD5 158d2f2c4ab4160bb97cb012088f7daa
BLAKE2b-256 f1a8c74e81c8cdcb3c501c0a16db7ca1f7533bbc20035948d325f36bf46297af

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