Skip to main content

A simple linear algebra package written in vanilla python3

Project description

linalg

PyPI version Documentation Status

Docs

Docs can be found at the readthedocs page

What is this?

NOT intended to be the best or fastest.

NOT intended to be production-grade (yet).

IS intended to be fully vanilla python3.

IS meant as an educational tool.

Technical details

This package uses black for formatting and semver for versioning.

Usage

This package provides the Matrix class and utility functions.

import linalg
from linalg import *  # import the Matrix class and utility functions top-level
from linalg import Matrix  # import the Matrix class

To create a matrix object, initialize it with a 2D list or use Matrix.zeroes() or Matrix.identity(). You can also use random_matrix().

mat = linalg.Matrix([[3, 4, 5], [2, 5, -1], [0, 2, 1]])  # 3x3 matrix
mat = linalg.as_matrix([[3, 4, 5], [2, 5, -1], [0, 2, 1]])  # 3x3 matrix, alternative notation
mat = linalg.zeroes(4, 2)  # 4x2 zero matrix
mat = linalg.identity(4)  # 4x4 identity matrix
mat = linalgrandom_matrix((2, 3), (-10, 10))  # 2x3 matrix with elements within (-10, 10)

After that, you can use multiple functions to perform linear algebraic operations as explained in the above linked docs.

Todo

  • Add other linear algebraic operations
  • Implement vectors
  • Add documentation

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

linalg-1.0.0.tar.gz (4.5 kB view details)

Uploaded Source

File details

Details for the file linalg-1.0.0.tar.gz.

File metadata

  • Download URL: linalg-1.0.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.19.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.26.0 CPython/3.7.3

File hashes

Hashes for linalg-1.0.0.tar.gz
Algorithm Hash digest
SHA256 ece41fa1148a5de2aafd0794386afcc13928070cc06bd7b6f9a33ac64ecb0cea
MD5 ee8d138293d4b0419893d29489f7a30f
BLAKE2b-256 87b0f15c3d9016fef64bd334f2248f9b399cdf880fe0734f64205a6d1a7322c9

See more details on using hashes here.

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