Skip to main content

A lightweight Python package for matrix operations.

Project description

MatrixForge

A lightweight Python package for performing common matrix operations.

Features

  • Matrix Addition
  • Matrix Subtraction
  • Matrix Multiplication
  • Matrix Transpose
  • Scalar Multiplication
  • Identity Matrix Generation
  • Determinant Calculation (Supports n × n matrices)

Installation

Clone the Repository

git clone https://github.com/Priyanshu-Mishra0930/MatrixForge.git
cd MatrixForge
pip install -e .

Download ZIP

  1. Click Code → Download ZIP
  2. Extract the archive
  3. Open a terminal in the project folder
  4. Run:
pip install -e .

Quick Start

from matrixcalc import (
    m_add,
    m_sub,
    m_mul,
    m_trans,
    m_s_mul,
    identity,
    determinant
)

A = [
    [1, 2],
    [3, 4]
]

B = [
    [5, 6],
    [7, 8]
]

print(m_add(A, B))
print(m_s_mul(A, 2))
print(identity(3))
print(determinant(A))

Output

[[6, 8], [10, 12]]

[[2, 4], [6, 8]]

[[1, 0, 0],
 [0, 1, 0],
 [0, 0, 1]]

-2

Available Functions

Function Description
m_add() Matrix Addition
m_sub() Matrix Subtraction
m_mul() Matrix Multiplication
m_trans() Matrix Transpose
m_s_mul() Scalar Multiplication
identity() Generate an Identity Matrix
determinant() Calculate Determinant of an n × n Matrix

Example

from matrixcalc import determinant

matrix = [
    [1, 2, 3],
    [0, 4, 5],
    [1, 0, 6]
]

print(determinant(matrix))

Output:

22

Requirements

  • Python 3.10+

Project Structure

matrixcalc/
├── addition.py
├── subtraction.py
├── multiplication.py
├── transpose.py
├── scalar_multiplication.py
├── identity.py
├── determinant.py
└── __init__.py

Version

Current Version: v1.2.0


Author

Prince

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

matrixforge_pm-1.2.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

matrixforge_pm-1.2.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file matrixforge_pm-1.2.0.tar.gz.

File metadata

  • Download URL: matrixforge_pm-1.2.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for matrixforge_pm-1.2.0.tar.gz
Algorithm Hash digest
SHA256 316e0d04fe1e80f844313587083588b9d0e56199c818b06e6c4651ee945aae71
MD5 802e5825243e97be232a89fec9089cfe
BLAKE2b-256 2062cab1bf711b26947951db51b524200c4a89c3066c9c2ea856679baee72f25

See more details on using hashes here.

File details

Details for the file matrixforge_pm-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: matrixforge_pm-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for matrixforge_pm-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 77ef8eba74ac1d6744358bf5144cb1e60160f3065f31d89e1de4e1d2a40324a8
MD5 f9ba071e451b3eeb2fb78a12fc3e8ab7
BLAKE2b-256 0cc92ee70599451e54acbfa553ef97603c07d9246a7b333c835a8d2ff3cab1d1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page