Skip to content

Generic matrix determinant calculator, works on arbitrary numpy data-types - Beta

License

Notifications You must be signed in to change notification settings

trundev/numpy-determinant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Matrix Determinant Calculator

Python module to calculate matrix and minor-matrix determinants from NumPy arrays.

Main goal

The module is intended to allow as-generic-as-posible determinant calculation, that does not rely on specific data-type. NumPy arrays of any dtype can be used as the source matrix.

The source ndarray.dtype objects should only support product (*) operation, sum() and negative() are optional. This includes generic Python objects, like.

Installation

The module can be installed from the GitHub repo:

pip install "git+https://github.com/trundev/numpy-determinant.git@main"

Usage

The main numpy_determinant.det() can be used just like the numpy.linalg.det():

>>> import numpy as np
>>> import numpy_determinant

>>> a = np.arange(9).reshape(3, 3)  # Some linearly dependent data
>>> a += a != 0         # Increase all elements, but the first one
>>> a
array([[0, 2, 3],
       [4, 5, 6],
       [7, 8, 9]])
>>> numpy_determinant.det(a)
3

See test folder for more examples

About

Generic matrix determinant calculator, works on arbitrary numpy data-types - Beta

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages