bareiss
v1.0.2
Published
Algorithm to calculate the determinant of the a matrix with integer entries using only integer arithmetic.
Downloads
14
Maintainers
Readme
Bareiss algorithm
In mathematics, the Bareiss algorithm, named after Erwin Bareiss, is an algorithm to calculate the determinant or the echelon form of a matrix with integer entries using only integer arithmetic; any divisions that are performed are guaranteed to be exact (there is no remainder). The method can also be used to compute the determinant of matrices with (approximated) real entries, avoiding the introduction any round-off errors beyond those already present in the input.
Installation
This is a Node.js module.
Installation is done using the npm install command:
npm i bareiss
Example of use
// Import the module
const Bareiss = require( 'bareiss' );
let K =
[ [ 42, 97, 23 ],
[ 51, 30, 77 ],
[ 33, 7, 66 ] ];
Bareiss.getDeterminant( K );
/*
{ determinant: -34062,
transformedMatrix:
[[ 1441, -6241, 6779 ],
[ -825, 2013, -2061 ],
[ -633, 2907, -3687 ]],
}
*/
The main function is:
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Authors
- Code:
- Original Paper: