numes
v1.1.0
Published
Lightweight matrix operations
Downloads
3
Readme
numes
Install
npm i numes
or
yarn add numes
Usage
numes
dosn't require any specific class, the regular two dimensional array is good enough, e.g.
const ndarray = [[1, 2, 3], [4, 5, 6]]
const ndarray2 = [[1, 2], [3, 4]]
therefore the library approach is just a composition of functions
add(transpose(ndarray2), ndarray2)
Operations
- add sums 2+ matrices/numbers
- divide divides 2+ matrices/numbers
- dot makes a dot product of 2+ matrices
- exponent returns an exponent of a matrix
- multiply multiplies 2+ matrices/numbers
- negative returns negative values for a matrix (literally multiply by -1)
- random generates a random matrix
- reciprocal returns a matrix with reciprocal of all elements
- shape returns
{rows, cols}
of a matrix - subtract subtracts 2+ matrices/numbers
- transpose tranposes (flips) a matrix over its diagonal