Skip to main content

linear algebra in your console

Project description

linacon

Linear algebra in your Console — yayo!

linacon runs in your terminal and provides a set of linear algebra commands. All operations are performed using NumPy.

Status: sections [0]–[4] of the Feature roadmap are implemented and reachable from the CLI — basic matrix operations, property checks, rotations, factorizations and least squares, all backed by NumPy in src/linacon/core. I/O beyond headerless CSV (section [5]) is still a roadmap.

Usage

Requires Python >= 3.14, NumPy and PyArrow.

Every feature is reached as <command> <feature>, loading its matrices from CSV files:

pip install linacon
# multiply two matrices
python -m linacon.main bmo matmul -f A.csv -g B.csv

# LU decomposition, written to CSV
python -m linacon.main factorization lu -f A.csv -out lu.csv

# ridge least squares (lambda via -k)
python -m linacon.main least-squares regularized -f A.csv -g b.csv -k 1.0

Use python -m linacon.main <command> <feature> --help to list a feature's flags.


I/O

You can set stdin and stdout to use files, pipes, or both in powerful combinations.

Loading Pipeline

The loader delegates parsing to PyArrow's pyarrow.csv.read_csv, configured for headerless numeric CSV: autogenerated column names, internal multi-threaded parsing, and no quoting/escaping for speed. The resulting Arrow table columns are stacked with np.column_stack into the final 2D NumPy array. See run.

Argument Parser

The parser is split by command (bmo, checks, rotation, factorization, least-squares), and each command exposes one sub-command per feature — every feature is reached through a command, never by direct access. Shared flags come from parent parsers: -f/--file (primary matrix), -g/--file2 (second operand), -k/--scalar, -b (start-to-end benchmark) and -out/--out (CSV output path). See get_argparse.

Output

When -out is given, the operation's result is written back as headerless CSV via PyArrow (loader-compatible). Multi-part results (e.g. P/L/U from a factorization, or the transform and transformed points from a rotation) are written one file per component as <stem>.<name><suffix>. See write_csv.


Feature

[0] Basic Matrix Operations

  • [0.1] matrix mul (arbitrary dimensions)
  • [0.2] matrix sum
  • [0.3] matrix scalar mul
  • [0.4] scalar dot product
  • [0.5] scalar sum
  • [0.6] inverse compute
  • [0.7] transpose compute
  • [0.8] rank compute

[1] Checks

  • [1.1] invertability check
  • [1.2] vectors independence check
  • [1.3] vectors orthogonality check
  • [1.4] symmetric check
  • [1.5] triangular check
  • [1.6] positive definite check

[2] Rotations

  • [2.1] rotation matrix computation (input: matrix, angle, [axis], [center], [scale], [shear], [perspective])

[3] Factorization

  • [3.1] gauss-jordan elimination
  • [3.2] LU decomposition
  • [3.3] LDU decomposition
  • [3.4] QR decomposition
  • [3.5] Cholesky decomposition
  • [3.6] orthogonal decomposition
  • [3.7] SVD
  • [3.8] eigenvalue decomposition

[4] Least Squares

  • [4.1] least squares
  • [4.2] weighted least squares
  • [4.3] least squares with regularization
  • [4.4] regularization
  • [4.5] linear regression

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

linacon-0.1.1.tar.gz (17.7 kB view details)

Uploaded Source

Built Distribution

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

linacon-0.1.1-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file linacon-0.1.1.tar.gz.

File metadata

  • Download URL: linacon-0.1.1.tar.gz
  • Upload date:
  • Size: 17.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.16

File hashes

Hashes for linacon-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6c579a0018968500a150f979d38aa7fa6798a575f8407be0cfece1a91d14e73d
MD5 5b25758082deadac25e46c027513416b
BLAKE2b-256 8434b445aa93720be9c94f42d8dc9cd6b3f86f96738c9646f8d8400d6bc057af

See more details on using hashes here.

File details

Details for the file linacon-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: linacon-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 16.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.16

File hashes

Hashes for linacon-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f829b1d5da9ec302c634d71a94839287d12483512251940b9e853bc7bcb83c11
MD5 7d9b80afde738d55d31d57e85fb963ac
BLAKE2b-256 91519e60eb99df344006abfaefc95ca255f6514483eecefffe85956932ae0b05

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