A library for matrix operations by Group 20
Project description
alumath_group20 : A Python library for matrix operations, supporting multiplication of matrices with different dimensions, developed by Group 20: Christian, Carine, Eva, and Thierry.
Installation
Install via pip: pip install alumath_group20
Usage The alumath_group20 library, created by Christian, Carine, Eva, and Thierry, provides a Matrix class for matrix multiplication with compatible dimensions.
Below are examples: Example 1: Multiplying Two 2x2 Matrices
from alumath_group20 import Matrix
Define two 2x2 matrices
A = Matrix([[1, 2], [3, 4]]) B = Matrix([[5, 6], [7, 8]])
Multiply using @
C = A @ B print("2x2 * 2x2 Matrix:") print(C)
Output: 2x2 * 2x2 Matrix: 19 22 43 50
Example 2: Multiplying a 2x3 Matrix by a 3x2 Matrix from alumath_group20 import Matrix
Define a 2x3 and a 3x2 matrix
X = Matrix([[1, 2, 3], [4, 5, 6]]) Y = Matrix([[7, 8], [9, 10], [11, 12]])
Multiply
Z = X @ Y print("2x3 * 3x2 Matrix:") print(Z)
Output: 2x3 * 3x2 Matrix: 58 64 139 154
Example 3: Handling Incompatible Dimensions from alumath_group20 import Matrix
Define incompatible matrices (1x2 and 3x1)
A = Matrix([[1, 2]]) B = Matrix([[1], [2], [3]])
try: C = A @ B except ValueError as e: print(e)
Output (member name varies): Matrix dimensions incompatible for multiplication, says Christian, Carine, Eva, or Thierry(name is picked randomly)
Notes :
Supports multiplication for compatible dimensions (m×n * n×p = m×p). For incompatible dimensions, raises ValueError with a message including a randomly selected member (Christian, Carine, Eva, or Thierry). Uses the @ operator for multiplication.
Development To contribute:
Clone the repository: git clone https://github.com/yourusername/alumath_group20.git cd alumath_group20
Install in editable mode: pip install -e .
Run tests: python -m unittest tests/test_matrix.py
License MIT License
Authors :
Christian Carine Eva Thierry
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file alumath_group20-0.1.0.tar.gz.
File metadata
- Download URL: alumath_group20-0.1.0.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e985818611142a7e7d63c0178dcf8cdf0f7037aedc4acec222d9709c924c41c9
|
|
| MD5 |
30ac82bbf96b6341f44487c34feaed52
|
|
| BLAKE2b-256 |
71f55a1f26bf03d1ad044b8890fb222782001be6fcf687eb1a9822f3ef2334df
|
File details
Details for the file alumath_group20-0.1.0-py3-none-any.whl.
File metadata
- Download URL: alumath_group20-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed46c06b2de57f4e4cace5bc8e55f5538c8dc5b587d03209b94687a4ab24dd64
|
|
| MD5 |
9788aa3eb738c2658396737f94d346b6
|
|
| BLAKE2b-256 |
b2945471ef03dcf82816e7d866bed16d7193e1c8e2675eb8c1719d38586b4d66
|