Skip to main content

Matrix on class

Project description

Matrix Class Library

This Python library provides an implementation of a matrix using classes, offering a range of functionalities for matrix operations.

Installation

Install the library using pip:

pip install matrix_class

Features

  • Initialization: Create matrices with specified rows and columns.
  • Item Assignment and Retrieval: Set and get values of specific cells in the matrix.
  • Matrix Properties: Access the number of rows and columns in the matrix.
  • String Representation: Print the matrix in a readable format.
  • Determinant Calculation: Compute the determinant of the matrix.
  • Matrix Arithmetic: Perform addition, subtraction, and multiplication (with both scalars and other matrices).
  • Matrix Transposition: Transpose the matrix, swapping rows with columns.
  • Matrix Inversion: Invert a matrix, provided it is square and has a non-zero determinant.
  • Matrix Complementation: Calculate the complement of a matrix.

Usage

Below are some examples of how to use the Matrix class:

from matrix import Matrix

# Create a new Matrix with specified dimensions
matrix = Matrix(3, 3)

# Set and get values
matrix[1, 1] = 5.0
value = matrix[1, 1]

# Access matrix properties
rows = matrix.rows
columns = matrix.columns

# Print the matrix
print(matrix)

# Perform arithmetic operations
sum_matrix = matrix1 + matrix2
difference = matrix1 - matrix2
product = matrix1 * matrix2
scaled_matrix = matrix * 2.0

# Transpose and invert matrices
transposed_matrix = matrix.get_transported()
inverse_matrix = matrix.get_inverse()

Contributing

Contributions to enhance the Matrix Class Library are welcomed. Please open an issue first to discuss proposed changes. Ensure to update tests as appropriate.

License

This library is released under the MIT License.

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

matrix_class-0.2.0.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

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

matrix_class-0.2.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file matrix_class-0.2.0.tar.gz.

File metadata

  • Download URL: matrix_class-0.2.0.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for matrix_class-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a9a8c83c92d3b19cbf23c8fc7d6dd8de990287b483b5a1f3e06155e2ea7e64df
MD5 e9de966a4fd4aefaca970445caf5d6cc
BLAKE2b-256 0af1f91bfd656dd9023a2c9f9b556a5e50b46c154b8b70071f48b12ea990841f

See more details on using hashes here.

File details

Details for the file matrix_class-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: matrix_class-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for matrix_class-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 484d167c43885e5f23c4d35b44561f1facde0d60bdf12b6507d6bafafcba2277
MD5 1c2441f1872271dc2d5ccc48b5be222b
BLAKE2b-256 67a87cde7eb85766060340950428fb83efbe9889d3e764b4cab07e25e2c7a671

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