Package Exports
- mx-computing
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (mx-computing) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Mx - Matrices computing library
Code examples
Create new matrix
new Mx.Matrix(number[][], number = 0)
Examples
const myMatrix1 = new Mx.Matrix([
[1, 5, 2],
[15, 19, 3],
[8, 4, 2]
])
// Creates matrix:
// 1 5 2
// 15 19 3
// 8 4 2
const myMatrix2 = new Mx.Matrix([
[4, 2],
[6],
[58, 4, 22]
])
// Creates matrix:
// 4 2 0
// 6 0 0
// 58 4 22
const myMatrix3 = new Mx.Matrix([
[4, 2],
[6],
[58, 4, 22]
], 13)
// Creates matrix:
// 4 2 13
// 6 13 13
// 58 4 22
Get matrix cell
MyMatrixObject.cell(number, number)
Examples
const myMatrix = new Mx.Matrix([
[1, 5],
[7, 8],
])
myMatrix.cell(0, 1)
// Returns: 7
Get matrix column
MyMatrixObject.column(number)
Examples
const myMatrix = new Mx.Matrix([
[1, 5, 4],
[7, 8, 2],
[2, 51, 12],
])
myMatrix.column(2)
// Returns: [4, 2, 12]
Get matrix columns number
MyMatrixObject.colNum()
Examples
const myMatrix = new Mx.Matrix([
[1, 5, 4],
[2, 51, 12],
])
myMatrix.colNum()
// Returns: 3
Get matrix row
MyMatrixObject.row(number)
Examples
const myMatrix = new Mx.Matrix([
[1, 5, 4],
[7, 8, 2],
[2, 51, 12],
])
myMatrix.row(1)
// Returns: [7, 8, 2]
Get matrix rows number
MyMatrixObject.rowNum()
Examples
const myMatrix = new Mx.Matrix([
[1, 5, 4],
[2, 51, 12],
])
myMatrix.rowNum()
// Returns: 2
Get matrix raw data
MyMatrixObject.raw()
Examples
const myMatrix = new Mx.Matrix([
[1, 5],
[7, 8]
])
myMatrix.raw()
// Returns: [[1, 5], [7, 8]]
Transpose matrix
MyMatrixObject.transpose()
Examples
const myMatrix = new Mx.Matrix([
[1, 5, 4],
[7, 8, 2],
[2, 51, 12],
])
const myTransposedMatrix = myMatrix.transpose()
// Returns new Mx.Matrix with data:
// 1 7 2
// 5 8 51
// 4 2 12
Available Scripts
In the project directory, you can run:
yarn
Install required dependencies
yarn start
Open http://localhost:3000 with auto-refresh
yarn lib
Built library final versions that will be placed in /lib
directory
Bash scripts
In the proroject directory /scripts, you can ron following bash scripts:
test-and-build.sh
Test and build library by yarn test
and yarn build
automatically.
publish.sh
Publish library to npm registry.
* Note that you are not albe to run that script because you are not equipped with npm auth token. That is just additional informaiton