const linearAlgebra = ;const Matrix = linearAlgebraMatrix; `const csv = require('csvtojson'); const convert = require('matrixa');
const math = ;const csv = ; const convert = ;
toMatrixArray
In areas like computational decision science and operation research it is common to work with collections of matrices. This package aims to provide a parser of csv that contains data from not one but several matrices. So this is a simple library extension for csvtojson to parse that csv with an array of matrices into a usable object of mathjs or linear-algebra npm library.
Installation
npm i matrixa
Example Usage
;
Returns:
data: 1 3 033 033 1 02 3 5 1 rows: 3 cols: 3
;
Returns:
Matrix _data: 1 3 033 033 1 02 3 5 1 _size: 3 3 _datatype: undefined
Documentation
Argument | Description | Mandatory | Type | Rules |
---|---|---|---|---|
jsonObj | jsonObj is the json array that contains the data from the csv. | True | JSON Array | Each row MUST contain the data of a matrix, rows separated by a blank column. |
package | package speficies which package you are using. | True | String | This argument MUST be a string containing 'mathjs' or 'linear-algebra' depending on the package the user wants to use. |
Package Dependencies
- linear-algebra
- mathjs
- csvtomatrix
License
MIT
Contributing
https://github.com/patelotech/toMatrixArray
Linting
- AIRBNB AIRBNB JS CODE STYLE
Configuration
- Eslint v-4.19.1 // AIRBNB Configuration
Linting scripts
- Error check:
npm run lint
- Error fix:
npm run lint-fix
ornpm run lint -- --fix