Skip to content

Retrieves matrix dimensions, their trace, and performs matrix addition, subtraction, multiplication, and scalar multiplication.

Notifications You must be signed in to change notification settings

beauvilerobed/py-matrix-package

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

py-Matrix-123

Installation

To install with pip:

pip install py-Matrix-123

Basic Usage

You can retrieve matrix dimensions, their trace, and performs matrix addition, subtraction, multiplication and scalar multiplication.

requirements: python3

Here's an example for regular matrices

from pymatrix123 import Matrix

"""    
    matrix A:
            1 
            3 
            4
            5

    matrix B:
            1
            0
            2
            5
"""

matrixA = Matrix([[1], [3], [4], [5]])
matrixB = Matrix([[1], [0], [2], [5]])
print(matrixA + matrixB)

Here's an example for square matrices

from pymatrix123 import SquareMatrix

"""    
    matrix A:
            1 2
            3 4

    matrix B:
            3 4
            2 1
"""
        
matrixA = SquareMatrix([[1, 2], [3, 4]])
matrixB = SquareMatrix([[4, 3], [2, 1]])
print(matrixA.trace())
print(matrixA.get_dim())
print(matrixB.trace())
print(matrixB.get_dim())
print(matrixA * matrixB)

Reference

Setup Command Notes
install pip install pymatrix123
Creating a CLI Command Notes
import import pymatrix123
Call Matrix(A) Turns the current list into a matrix object.
Call SquareMatrix(B) Turns the current list into a matrix object.

License

Licensed under the The Python Packaging Authority License.

About

Retrieves matrix dimensions, their trace, and performs matrix addition, subtraction, multiplication, and scalar multiplication.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages