Skip to main content

A library that deals with matrix and vector operations.

Project description

Matrixlib

NOTICE

"rank" and "inverse" functions are a work in progress, they DO NOT WORK.


A basic library for matrix and vector operations. Any feedback is highly encouraged. I enjoy trying to create modules and programs that work with mathematical functions and data. I also like looking into higher end modules and researching the processes and programs they use to perform tasks. Any feedback will be taken and acted upon.



Installation


Use the package manager pip to install matrixlib_jfj.

Release Versions:

pip install matrixlib_jfj

Test Versions:

pip install -i https://test.pypi.org/simple matrixlib-jfj


General Usage


import matrixlib_jfj as ml

# matrix = ml.matrix.Matrix(rowcols=(x, y) or values=[[nested list(s) with values assigned]]) Initialises the matrix.
Example:
matrix = ml.matrix.Matrix(rowcols=(3, 3))
>>> [[0, 0, 0], [0, 0, 0], [0, 0, 0]]

print(matrix)
    +-       -+
    | 0  0  0 |
>>> | 0  0  0 |
    | 0  0  0 |
    +-       -+

# matrix.random(a, b) Adds random values to the entire matrix
Example:
matrix.random(1, 10)
    +-          -+
    |7    10   7 |
>>> |1    1    7 |
    |10   5    8 |
    +-          -+

# matrix.identity() Creates an identity matrix from an existing square matrix
    +-       -+
    |1   0   0|
>>> |0   1   0|
    |0   0   1|
    +-       -+

### Adding ###
matrix1 = ml.matrix.Matrix(values=[
    [1, 2, 3],
    [4, 5, 6],
    [7, 8, 9]
])

matrix2 = ml.matrix.Matrix(values=[
    [9, 8, 7],
    [6, 5, 4],
    [3, 2, 1]
])

    +-          -+
    |10   10   10|
>>> |10   10   10|
    |10   10   10|
    +-          -+


Updates


Update 0.0.7

Added "get_submatrix" function that gets the submatrix of any square matrix, added the "det" function which gets the determinant of a square matrix.


Update 0.0.8

Fixed bug where an external program would run when the user of the package would run their own program.

Update 0.0.81

Updated README file to reflect certain information.

Update 0.0.82

Fixed Type Annotations.

Update 0.1.82

Removed Deprecations, Removed functionality in utils.py (Temporary) added better typing, improved cumsum function.

Update 0.1.90

Added temporary base case to Matrix.rank() function.

Contributing


Any and All feedback and help is highly encouraged. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License


GNU General Public License v3.0

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

matrixlib_jfj-0.2.5.tar.gz (21.2 kB view hashes)

Uploaded Source

Built Distribution

matrixlib_jfj-0.2.5-py2.py3-none-any.whl (20.4 kB view hashes)

Uploaded Python 2 Python 3

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