diff --git a/gulpfile.js b/gulpfile.js index 9c2b6ed66..4955520d8 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -7,7 +7,7 @@ const babel = require('gulp-babel') const uglify = require('uglify-js') const docgenerator = require('./tools/docgenerator') -const ENTRY = './src/index.js' +const ENTRY = './src/main.js' const HEADER = './src/header.js' const VERSION = './src/version.js' const COMPILE_SRC = './src/**/*.js' diff --git a/index.js b/index.js index 89c56453e..ee970de8e 100644 --- a/index.js +++ b/index.js @@ -1 +1 @@ -module.exports = require('./lib/index') +module.exports = require('./lib/main') diff --git a/src/index.js b/src/index.js index 176451156..cdb34513d 100644 --- a/src/index.js +++ b/src/index.js @@ -1,47 +1,10 @@ -'use strict' +// This file contains all factory functions of math.js -import core from './core/core' - -/** - * math.js factory function. Creates a new instance of math.js - * - * @param {Object} [config] Available configuration options: - * {number} epsilon - * Minimum relative difference between two - * compared values, used by all comparison functions. - * {string} matrix - * A string 'matrix' (default) or 'array'. - * {string} number - * A string 'number' (default), 'bignumber', or - * 'fraction' - * {number} precision - * The number of significant digits for BigNumbers. - * Not applicable for Numbers. - * {boolean} predictable - * Predictable output type of functions. When true, - * output type depends only on the input types. When - * false (default), output type can vary depending - * on input values. For example `math.sqrt(-4)` - * returns `complex('2i')` when predictable is false, and - * returns `NaN` when true. - */ -function create (config) { - // create a new math.js instance - const math = core.create(config) - math.create = create - - // import data types, functions, constants, expression parser, etc. - math['import']([ - require('./type'), // data types (Matrix, Complex, Unit, ...) - require('./constants'), // constants - require('./expression'), // expression parsing - require('./function'), // functions - require('./json'), // serialization utility (math.json.reviver) - require('./error') // errors - ]) - - return math -} - -// return a new instance of math.js -module.exports = create() +module.exports = [ + require('./type'), // data types (Matrix, Complex, Unit, ...) + require('./constants'), // constants + require('./expression'), // expression parsing + require('./function'), // functions + require('./json'), // serialization utility (math.json.reviver) + require('./error') // errors +] diff --git a/src/main.js b/src/main.js new file mode 100644 index 000000000..557eec0e4 --- /dev/null +++ b/src/main.js @@ -0,0 +1,40 @@ +'use strict' + +import core from './core/core' + +/** + * math.js factory function. Creates a new instance of math.js + * + * @param {Object} [config] Available configuration options: + * {number} epsilon + * Minimum relative difference between two + * compared values, used by all comparison functions. + * {string} matrix + * A string 'matrix' (default) or 'array'. + * {string} number + * A string 'number' (default), 'bignumber', or + * 'fraction' + * {number} precision + * The number of significant digits for BigNumbers. + * Not applicable for Numbers. + * {boolean} predictable + * Predictable output type of functions. When true, + * output type depends only on the input types. When + * false (default), output type can vary depending + * on input values. For example `math.sqrt(-4)` + * returns `complex('2i')` when predictable is false, and + * returns `NaN` when true. + */ +function create (config) { + // create a new math.js instance + const math = core.create(config) + math.create = create + + // import data types, functions, constants, expression parser, etc. + math['import'](require('./index')) + + return math +} + +// return a new instance of math.js +module.exports = create() diff --git a/test-dist/lib.test.js b/test-dist/lib.test.js index 6d11b5d90..bbf9cdada 100644 --- a/test-dist/lib.test.js +++ b/test-dist/lib.test.js @@ -3,7 +3,7 @@ const version = require('../package.json').version describe('lib', function () { it('should load lib/index.js', function () { - const math = require('../lib/index.js') + const math = require('../lib/main') assert.equal(math.add(2, 3), 5) assert.equal(math.version, version) diff --git a/test-node/function/alegbra/decomposition/slu.test.js b/test-node/function/alegbra/decomposition/slu.test.js index 942293099..de0071fe2 100644 --- a/test-node/function/alegbra/decomposition/slu.test.js +++ b/test-node/function/alegbra/decomposition/slu.test.js @@ -1,4 +1,4 @@ -const approx = require('../../../../tools/approx'), math = require('../../../../src/index'), market = require('../../../../tools/matrixmarket') +const approx = require('../../../../tools/approx'), math = require('../../../../src/main'), market = require('../../../../tools/matrixmarket') describe('slu - matrix market', function () { it('should decompose matrix, 48 x 48, natural ordering (order=0), full pivoting, matrix market', function (done) { diff --git a/test-node/function/alegbra/sparse/cs_amd.test.js b/test-node/function/alegbra/sparse/cs_amd.test.js index 9470ebe02..4e5ea01fa 100644 --- a/test-node/function/alegbra/sparse/cs_amd.test.js +++ b/test-node/function/alegbra/sparse/cs_amd.test.js @@ -1,7 +1,7 @@ const assert = require('assert') const approx = require('../../../../tools/approx') const market = require('../../../../tools/matrixmarket') -const math = require('../../../../src/index').create() +const math = require('../../../../src/main').create() math.import(require('../../../../src/function/algebra/sparse/cs_amd')) const cs_amd = math.sparse.cs_amd diff --git a/test-node/function/alegbra/sparse/cs_lu.test.js b/test-node/function/alegbra/sparse/cs_lu.test.js index 4599ddec5..3501176bb 100644 --- a/test-node/function/alegbra/sparse/cs_lu.test.js +++ b/test-node/function/alegbra/sparse/cs_lu.test.js @@ -1,7 +1,7 @@ const assert = require('assert') const approx = require('../../../../tools/approx') const market = require('../../../../tools/matrixmarket') -const math = require('../../../../src/index').create() +const math = require('../../../../src/main').create() math.import(require('../../../../src/function/algebra/sparse/cs_permute')) math.import(require('../../../../src/function/algebra/sparse/cs_lu')) diff --git a/test-node/function/arithmetic/multiply.test.js b/test-node/function/arithmetic/multiply.test.js index 2cf6035e3..a67083f2d 100644 --- a/test-node/function/arithmetic/multiply.test.js +++ b/test-node/function/arithmetic/multiply.test.js @@ -1,5 +1,5 @@ // test multiply -const math = require('../../../src/index') +const math = require('../../../src/main') const market = require('../../../tools/matrixmarket') describe('multiply', function () { diff --git a/test/constants.test.js b/test/constants.test.js index 785586274..6535e2e71 100644 --- a/test/constants.test.js +++ b/test/constants.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), math = require('../src/index'), approx = require('../tools/approx') +const assert = require('assert'), math = require('../src/main'), approx = require('../tools/approx') describe('constants', function () { describe('number', function () { diff --git a/test/core/config.test.js b/test/core/config.test.js index de3bc780a..cfe35bfe5 100644 --- a/test/core/config.test.js +++ b/test/core/config.test.js @@ -1,5 +1,5 @@ const assert = require('assert') -const math = require('../../src/index') +const math = require('../../src/main') describe('config', function () { // TODO: test function config diff --git a/test/core/import.test.js b/test/core/import.test.js index 6740c7d2b..03674f8a3 100644 --- a/test/core/import.test.js +++ b/test/core/import.test.js @@ -1,6 +1,6 @@ // test import const assert = require('assert') -const mathjs = require('../../src/index') +const mathjs = require('../../src/main') const approx = require('../../tools/approx') describe('import', function () { diff --git a/test/core/typed.test.js b/test/core/typed.test.js index eb924b581..2d630fae9 100644 --- a/test/core/typed.test.js +++ b/test/core/typed.test.js @@ -1,5 +1,5 @@ const assert = require('assert') -const math = require('../../src/index') +const math = require('../../src/main') const math2 = math.create() describe('typed', function () { diff --git a/test/deprecated.test.js b/test/deprecated.test.js index 3aa573b01..7e54d1d17 100644 --- a/test/deprecated.test.js +++ b/test/deprecated.test.js @@ -1,6 +1,6 @@ // test error messages for deprecated functions const assert = require('assert') -const math = require('../src/index') +const math = require('../src/main') describe('deprecated stuff', function () { it('should throw a deprecation error when using UpdateNode', function () { diff --git a/test/expression/Help.test.js b/test/expression/Help.test.js index bfe77341c..ab065749c 100644 --- a/test/expression/Help.test.js +++ b/test/expression/Help.test.js @@ -1,6 +1,6 @@ // test Help const assert = require('assert') -const math = require('../../src/index') +const math = require('../../src/main') const Help = math.type.Help describe('help', function () { diff --git a/test/expression/Parser.test.js b/test/expression/Parser.test.js index 94f05b70c..d88728bcd 100644 --- a/test/expression/Parser.test.js +++ b/test/expression/Parser.test.js @@ -1,6 +1,6 @@ // test parser -const assert = require('assert'), approx = require('../../tools/approx'), math = require('../../src/index'), Parser = math.expression.Parser +const assert = require('assert'), approx = require('../../tools/approx'), math = require('../../src/main'), Parser = math.expression.Parser describe('parser', function () { it('should create a parser', function () { diff --git a/test/expression/function/compile.test.js b/test/expression/function/compile.test.js index 47a862467..9f05ab38a 100644 --- a/test/expression/function/compile.test.js +++ b/test/expression/function/compile.test.js @@ -1,6 +1,6 @@ // test compile const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') describe('compile', function () { it('should compile an expression', function () { diff --git a/test/expression/function/eval.test.js b/test/expression/function/eval.test.js index 3d2c9cf86..ffaa1de82 100644 --- a/test/expression/function/eval.test.js +++ b/test/expression/function/eval.test.js @@ -1,7 +1,7 @@ // test eval const assert = require('assert') const approx = require('../../../tools/approx') -const math = require('../../../src/index') +const math = require('../../../src/main') const Complex = math.type.Complex const Matrix = math.type.Matrix const Unit = math.type.Unit diff --git a/test/expression/function/help.test.js b/test/expression/function/help.test.js index 76a8a4202..b765948ac 100644 --- a/test/expression/function/help.test.js +++ b/test/expression/function/help.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/index') +const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/main') describe('help', function () { it('should find documentation for a function by its name', function () { diff --git a/test/expression/function/parse.test.js b/test/expression/function/parse.test.js index 47fa14b8c..1f714e182 100644 --- a/test/expression/function/parse.test.js +++ b/test/expression/function/parse.test.js @@ -1,7 +1,7 @@ // test parse const assert = require('assert') const error = require('../../../src/error/index') -const math = require('../../../src/index') +const math = require('../../../src/main') const Node = math.expression.node.Node describe('parse', function () { diff --git a/test/expression/function/parser.test.js b/test/expression/function/parser.test.js index c7ea475dc..5087f56ba 100644 --- a/test/expression/function/parser.test.js +++ b/test/expression/function/parser.test.js @@ -1,5 +1,5 @@ const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') const Parser = math.expression.Parser describe('parser', function () { diff --git a/test/expression/node/AccessorNode.test.js b/test/expression/node/AccessorNode.test.js index 99cb75c50..853a3638d 100644 --- a/test/expression/node/AccessorNode.test.js +++ b/test/expression/node/AccessorNode.test.js @@ -1,8 +1,8 @@ // test AccessorNode const assert = require('assert') const approx = require('../../../tools/approx') -const math = require('../../../src/index') -const bigmath = require('../../../src/index').create({number: 'BigNumber'}) +const math = require('../../../src/main') +const bigmath = require('../../../src/main').create({number: 'BigNumber'}) const Node = math.expression.node.Node const ConstantNode = math.expression.node.ConstantNode const OperatorNode = math.expression.node.OperatorNode diff --git a/test/expression/node/ArrayNode.test.js b/test/expression/node/ArrayNode.test.js index 000ec1398..97557283e 100644 --- a/test/expression/node/ArrayNode.test.js +++ b/test/expression/node/ArrayNode.test.js @@ -1,7 +1,7 @@ // test ArrayNode const assert = require('assert') const approx = require('../../../tools/approx') -const math = require('../../../src/index') +const math = require('../../../src/main') const Node = math.expression.node.Node const ConstantNode = math.expression.node.ConstantNode const SymbolNode = math.expression.node.SymbolNode diff --git a/test/expression/node/AssignmentNode.test.js b/test/expression/node/AssignmentNode.test.js index d4ebcfbf3..39fda0aa0 100644 --- a/test/expression/node/AssignmentNode.test.js +++ b/test/expression/node/AssignmentNode.test.js @@ -1,7 +1,7 @@ // test AssignmentNode const assert = require('assert') const approx = require('../../../tools/approx') -const math = require('../../../src/index') +const math = require('../../../src/main') const Node = math.expression.node.Node const AccessorNode = math.expression.node.AccessorNode const ConstantNode = math.expression.node.ConstantNode diff --git a/test/expression/node/BlockNode.test.js b/test/expression/node/BlockNode.test.js index b38e5acfa..222c9db4f 100644 --- a/test/expression/node/BlockNode.test.js +++ b/test/expression/node/BlockNode.test.js @@ -1,7 +1,7 @@ // test BlockNode const assert = require('assert') const approx = require('../../../tools/approx') -const math = require('../../../src/index') +const math = require('../../../src/main') const Node = math.expression.node.Node const ConstantNode = math.expression.node.ConstantNode const SymbolNode = math.expression.node.SymbolNode diff --git a/test/expression/node/ConditionalNode.test.js b/test/expression/node/ConditionalNode.test.js index 8329a692e..692d86cf4 100644 --- a/test/expression/node/ConditionalNode.test.js +++ b/test/expression/node/ConditionalNode.test.js @@ -1,7 +1,7 @@ // test ConditionalNode const assert = require('assert') const approx = require('../../../tools/approx') -const math = require('../../../src/index') +const math = require('../../../src/main') const Node = math.expression.node.Node const ConstantNode = math.expression.node.ConstantNode const SymbolNode = math.expression.node.SymbolNode diff --git a/test/expression/node/ConstantNode.test.js b/test/expression/node/ConstantNode.test.js index 0e737d5c0..8d4fb205d 100644 --- a/test/expression/node/ConstantNode.test.js +++ b/test/expression/node/ConstantNode.test.js @@ -1,8 +1,8 @@ // test ConstantNode const assert = require('assert') const approx = require('../../../tools/approx') -const math = require('../../../src/index') -const bigmath = require('../../../src/index').create({number: 'BigNumber'}) +const math = require('../../../src/main') +const bigmath = require('../../../src/main').create({number: 'BigNumber'}) const Node = math.expression.node.Node const ConstantNode = math.expression.node.ConstantNode const SymbolNode = math.expression.node.SymbolNode diff --git a/test/expression/node/FunctionAssignmentNode.test.js b/test/expression/node/FunctionAssignmentNode.test.js index f5d1a504e..76b4f522c 100644 --- a/test/expression/node/FunctionAssignmentNode.test.js +++ b/test/expression/node/FunctionAssignmentNode.test.js @@ -1,7 +1,7 @@ // test FunctionAssignmentNode const assert = require('assert') const approx = require('../../../tools/approx') -const math = require('../../../src/index').create() +const math = require('../../../src/main').create() const Node = math.expression.node.Node const ConstantNode = math.expression.node.ConstantNode const SymbolNode = math.expression.node.SymbolNode diff --git a/test/expression/node/FunctionNode.test.js b/test/expression/node/FunctionNode.test.js index 8cc58a240..556d34577 100644 --- a/test/expression/node/FunctionNode.test.js +++ b/test/expression/node/FunctionNode.test.js @@ -1,7 +1,7 @@ // test FunctionNode const assert = require('assert') const approx = require('../../../tools/approx') -const math = require('../../../src/index').create() +const math = require('../../../src/main').create() const Node = math.expression.node.Node const ConstantNode = math.expression.node.ConstantNode const SymbolNode = math.expression.node.SymbolNode diff --git a/test/expression/node/IndexNode.test.js b/test/expression/node/IndexNode.test.js index a5993c408..9a23aa952 100644 --- a/test/expression/node/IndexNode.test.js +++ b/test/expression/node/IndexNode.test.js @@ -1,7 +1,7 @@ // test IndexNode const assert = require('assert') const approx = require('../../../tools/approx') -const math = require('../../../src/index') +const math = require('../../../src/main') const Node = math.expression.node.Node const ConstantNode = math.expression.node.ConstantNode const SymbolNode = math.expression.node.SymbolNode diff --git a/test/expression/node/Node.test.js b/test/expression/node/Node.test.js index 9d26650a2..852a8a7e6 100644 --- a/test/expression/node/Node.test.js +++ b/test/expression/node/Node.test.js @@ -1,7 +1,7 @@ // test Node const assert = require('assert') const approx = require('../../../tools/approx') -const math = require('../../../src/index') +const math = require('../../../src/main') const Node = math.expression.node.Node describe('Node', function () { diff --git a/test/expression/node/ObjectNode.test.js b/test/expression/node/ObjectNode.test.js index bbc3feb48..97210c37e 100644 --- a/test/expression/node/ObjectNode.test.js +++ b/test/expression/node/ObjectNode.test.js @@ -1,7 +1,7 @@ // test ObjectNode const assert = require('assert') const approx = require('../../../tools/approx') -const math = require('../../../src/index') +const math = require('../../../src/main') const Node = math.expression.node.Node const ConstantNode = math.expression.node.ConstantNode const SymbolNode = math.expression.node.SymbolNode diff --git a/test/expression/node/OperatorNode.test.js b/test/expression/node/OperatorNode.test.js index c2cef0780..fa066028c 100644 --- a/test/expression/node/OperatorNode.test.js +++ b/test/expression/node/OperatorNode.test.js @@ -1,7 +1,7 @@ // test OperatorNode const assert = require('assert') const approx = require('../../../tools/approx') -const math = require('../../../src/index') +const math = require('../../../src/main') const Node = math.expression.node.Node const ConstantNode = math.expression.node.ConstantNode const SymbolNode = math.expression.node.SymbolNode diff --git a/test/expression/node/ParenthesisNode.test.js b/test/expression/node/ParenthesisNode.test.js index adbe962e5..cca99d9d0 100644 --- a/test/expression/node/ParenthesisNode.test.js +++ b/test/expression/node/ParenthesisNode.test.js @@ -1,7 +1,7 @@ // test SymbolNode const assert = require('assert') const approx = require('../../../tools/approx') -const math = require('../../../src/index') +const math = require('../../../src/main') const Node = math.expression.node.Node const ConstantNode = math.expression.node.ConstantNode const OperatorNode = math.expression.node.OperatorNode diff --git a/test/expression/node/RangeNode.test.js b/test/expression/node/RangeNode.test.js index 9bb3128f6..68d71a0b2 100644 --- a/test/expression/node/RangeNode.test.js +++ b/test/expression/node/RangeNode.test.js @@ -1,7 +1,7 @@ // test RangeNode const assert = require('assert') const approx = require('../../../tools/approx') -const math = require('../../../src/index') +const math = require('../../../src/main') const Node = math.expression.node.Node const ConstantNode = math.expression.node.ConstantNode const SymbolNode = math.expression.node.SymbolNode diff --git a/test/expression/node/SymbolNode.test.js b/test/expression/node/SymbolNode.test.js index 17f6f6d54..79324fefd 100644 --- a/test/expression/node/SymbolNode.test.js +++ b/test/expression/node/SymbolNode.test.js @@ -1,7 +1,7 @@ // test SymbolNode const assert = require('assert') const approx = require('../../../tools/approx') -const math = require('../../../src/index') +const math = require('../../../src/main') const Node = math.expression.node.Node const ConstantNode = math.expression.node.ConstantNode const SymbolNode = math.expression.node.SymbolNode diff --git a/test/expression/operators.test.js b/test/expression/operators.test.js index eb7074f53..f5d767acb 100644 --- a/test/expression/operators.test.js +++ b/test/expression/operators.test.js @@ -1,6 +1,6 @@ const assert = require('assert') -const math = require('../../src/index') +const math = require('../../src/main') const operators = require('../../src/expression/operators') const OperatorNode = math.expression.node.OperatorNode const AssignmentNode = math.expression.node.AssignmentNode diff --git a/test/expression/parse.test.js b/test/expression/parse.test.js index e077d6876..47acd5f16 100644 --- a/test/expression/parse.test.js +++ b/test/expression/parse.test.js @@ -1,7 +1,7 @@ // test parse const assert = require('assert') const approx = require('../../tools/approx') -const math = require('../../src/index') +const math = require('../../src/main') const ArgumentsError = require('../../src/error/ArgumentsError') const parse = math.expression.parse const ConditionalNode = math.expression.node.ConditionalNode diff --git a/test/expression/security.test.js b/test/expression/security.test.js index 2db902b9c..43f65f217 100644 --- a/test/expression/security.test.js +++ b/test/expression/security.test.js @@ -1,5 +1,5 @@ const assert = require('assert') -const math = require('../../src/index') +const math = require('../../src/main') describe('security', function () { it('should not allow calling Function via constructor', function () { diff --git a/test/expression/transforms.test.js b/test/expression/transforms.test.js index a5fd9b2ea..8aca39cc4 100644 --- a/test/expression/transforms.test.js +++ b/test/expression/transforms.test.js @@ -1,7 +1,7 @@ // test transforms const assert = require('assert') const approx = require('../../tools/approx') -const math = require('../../src/index') +const math = require('../../src/main') const parse = math.expression.parse describe('transforms', function () { diff --git a/test/function/algebra/decomposition/lup.test.js b/test/function/algebra/decomposition/lup.test.js index 5b3d3c138..21b152a52 100644 --- a/test/function/algebra/decomposition/lup.test.js +++ b/test/function/algebra/decomposition/lup.test.js @@ -1,5 +1,5 @@ // test lup -const assert = require('assert'), approx = require('../../../../tools/approx'), math = require('../../../../src/index') +const assert = require('assert'), approx = require('../../../../tools/approx'), math = require('../../../../src/main') describe('lup', function () { it('should decompose matrix, n x n, no permutations, array', function () { diff --git a/test/function/algebra/decomposition/qr.test.js b/test/function/algebra/decomposition/qr.test.js index 680d9dcb4..d751357b4 100644 --- a/test/function/algebra/decomposition/qr.test.js +++ b/test/function/algebra/decomposition/qr.test.js @@ -1,5 +1,5 @@ // test lup -const assert = require('assert'), approx = require('../../../../tools/approx'), math = require('../../../../src/index') +const assert = require('assert'), approx = require('../../../../tools/approx'), math = require('../../../../src/main') /** * Tests whether `Q` and `R` are the valid QR decomposition of `A`. diff --git a/test/function/algebra/decomposition/slu.test.js b/test/function/algebra/decomposition/slu.test.js index 6d48d6b37..40d2e12da 100644 --- a/test/function/algebra/decomposition/slu.test.js +++ b/test/function/algebra/decomposition/slu.test.js @@ -1,4 +1,4 @@ -const approx = require('../../../../tools/approx'), math = require('../../../../src/index') +const approx = require('../../../../tools/approx'), math = require('../../../../src/main') describe('slu', function () { it('should decompose matrix, 4 x 4, natural ordering (order=0), partial pivoting', function () { diff --git a/test/function/algebra/derivative.test.js b/test/function/algebra/derivative.test.js index 2d7c3399a..8f1557b2a 100644 --- a/test/function/algebra/derivative.test.js +++ b/test/function/algebra/derivative.test.js @@ -1,6 +1,6 @@ // test derivative const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') const OperatorNode = math.expression.node.OperatorNode const ConstantNode = math.expression.node.ConstantNode const SymbolNode = math.expression.node.SymbolNode diff --git a/test/function/algebra/rationalize.test.js b/test/function/algebra/rationalize.test.js index 396c00227..32e7219f7 100644 --- a/test/function/algebra/rationalize.test.js +++ b/test/function/algebra/rationalize.test.js @@ -1,7 +1,7 @@ 'use strict' const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') /** * Transform node, array and single type value in a string with no spaces inside. diff --git a/test/function/algebra/simplify.test.js b/test/function/algebra/simplify.test.js index bab4f954c..700bbf5ef 100644 --- a/test/function/algebra/simplify.test.js +++ b/test/function/algebra/simplify.test.js @@ -1,6 +1,6 @@ // test simplify const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') describe('simplify', function () { function simplifyAndCompare (left, right, scope) { diff --git a/test/function/algebra/solver/lsolve.test.js b/test/function/algebra/solver/lsolve.test.js index 57284fe1b..47409e67f 100644 --- a/test/function/algebra/solver/lsolve.test.js +++ b/test/function/algebra/solver/lsolve.test.js @@ -1,5 +1,5 @@ // test lsolve -const assert = require('assert'), approx = require('../../../../tools/approx'), math = require('../../../../src/index') +const assert = require('assert'), approx = require('../../../../tools/approx'), math = require('../../../../src/main') describe('lsolve', function () { it('should solve linear system 4 x 4, arrays', function () { diff --git a/test/function/algebra/solver/lusolve.test.js b/test/function/algebra/solver/lusolve.test.js index ca27f83bf..a73d18240 100644 --- a/test/function/algebra/solver/lusolve.test.js +++ b/test/function/algebra/solver/lusolve.test.js @@ -1,5 +1,5 @@ // test lusolve -const assert = require('assert'), approx = require('../../../../tools/approx'), math = require('../../../../src/index') +const assert = require('assert'), approx = require('../../../../tools/approx'), math = require('../../../../src/main') describe('lusolve', function () { it('should solve linear system 4 x 4, arrays', function () { diff --git a/test/function/algebra/solver/usolve.test.js b/test/function/algebra/solver/usolve.test.js index 990e35836..c3b2d8bb6 100644 --- a/test/function/algebra/solver/usolve.test.js +++ b/test/function/algebra/solver/usolve.test.js @@ -1,5 +1,5 @@ // test usolve -const assert = require('assert'), approx = require('../../../../tools/approx'), math = require('../../../../src/index') +const assert = require('assert'), approx = require('../../../../tools/approx'), math = require('../../../../src/main') describe('usolve', function () { it('should solve linear system 4 x 4, arrays', function () { diff --git a/test/function/algebra/sparse/cs_lu.test.js b/test/function/algebra/sparse/cs_lu.test.js index f49a3ae00..108e6448a 100644 --- a/test/function/algebra/sparse/cs_lu.test.js +++ b/test/function/algebra/sparse/cs_lu.test.js @@ -1,6 +1,6 @@ const assert = require('assert') const approx = require('../../../../tools/approx') -const math = require('../../../../src/index').create() +const math = require('../../../../src/main').create() math.import(require('../../../../src/function/algebra/sparse/cs_permute')) math.import(require('../../../../src/function/algebra/sparse/cs_lu')) math.import(require('../../../../src/function/algebra/sparse/cs_sqr')) diff --git a/test/function/arithmetic/abs.test.js b/test/function/arithmetic/abs.test.js index 38854aa4a..b2e9bba8b 100644 --- a/test/function/arithmetic/abs.test.js +++ b/test/function/arithmetic/abs.test.js @@ -1,6 +1,6 @@ // test abs const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') describe('abs', function () { it('should return the abs value of a boolean', function () { diff --git a/test/function/arithmetic/add.test.js b/test/function/arithmetic/add.test.js index a81a6bcdc..58f5bee4a 100644 --- a/test/function/arithmetic/add.test.js +++ b/test/function/arithmetic/add.test.js @@ -1,7 +1,7 @@ // test add const assert = require('assert') const approx = require('../../../tools/approx') -const math = require('../../../src/index') +const math = require('../../../src/main') const add = math.add // TODO: make unit tests independent of math diff --git a/test/function/arithmetic/addScalar.test.js b/test/function/arithmetic/addScalar.test.js index 9436b6aa8..5b40a7bbb 100644 --- a/test/function/arithmetic/addScalar.test.js +++ b/test/function/arithmetic/addScalar.test.js @@ -1,7 +1,7 @@ // test add const assert = require('assert') const approx = require('../../../tools/approx') -const math = require('../../../src/index') +const math = require('../../../src/main') const BigNumber = require('decimal.js') const add = math.add diff --git a/test/function/arithmetic/cbrt.test.js b/test/function/arithmetic/cbrt.test.js index 091cc511b..7ba5d83f4 100644 --- a/test/function/arithmetic/cbrt.test.js +++ b/test/function/arithmetic/cbrt.test.js @@ -2,7 +2,7 @@ const assert = require('assert') const approx = require('../../../tools/approx') const error = require('../../../src/error/index') -const math = require('../../../src/index') +const math = require('../../../src/main') const cbrt = math.cbrt const bignumber = math.bignumber const complex = math.complex diff --git a/test/function/arithmetic/ceil.test.js b/test/function/arithmetic/ceil.test.js index c6409d756..744ed39ad 100644 --- a/test/function/arithmetic/ceil.test.js +++ b/test/function/arithmetic/ceil.test.js @@ -1,7 +1,7 @@ // test ceil const assert = require('assert') const approx = require('../../../tools/approx') -const math = require('../../../src/index') +const math = require('../../../src/main') const bignumber = math.bignumber const complex = math.complex const fraction = math.fraction diff --git a/test/function/arithmetic/cube.test.js b/test/function/arithmetic/cube.test.js index 4521995fa..461f19886 100644 --- a/test/function/arithmetic/cube.test.js +++ b/test/function/arithmetic/cube.test.js @@ -1,6 +1,6 @@ // test cube const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') const unit = math.unit const bignumber = math.bignumber const fraction = math.fraction diff --git a/test/function/arithmetic/divide.test.js b/test/function/arithmetic/divide.test.js index 65a4cfc28..e5bdf19de 100644 --- a/test/function/arithmetic/divide.test.js +++ b/test/function/arithmetic/divide.test.js @@ -1,6 +1,6 @@ // test divide const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') const error = require('../../../src/error/index') const approx = require('../../../tools/approx') const divide = math.divide diff --git a/test/function/arithmetic/dotDivide.test.js b/test/function/arithmetic/dotDivide.test.js index 97331b5db..1bb71a24b 100644 --- a/test/function/arithmetic/dotDivide.test.js +++ b/test/function/arithmetic/dotDivide.test.js @@ -1,5 +1,5 @@ // test dotDivide (element-wise divide) -const assert = require('assert'), math = require('../../../src/index'), approx = require('../../../tools/approx'), dotDivide = math.dotDivide, complex = math.complex +const assert = require('assert'), math = require('../../../src/main'), approx = require('../../../tools/approx'), dotDivide = math.dotDivide, complex = math.complex describe('dotDivide', function () { it('should divide two numbers', function () { diff --git a/test/function/arithmetic/dotMultiply.test.js b/test/function/arithmetic/dotMultiply.test.js index 1ced34add..be0b361f1 100644 --- a/test/function/arithmetic/dotMultiply.test.js +++ b/test/function/arithmetic/dotMultiply.test.js @@ -1,5 +1,5 @@ // test dotMultiply (element-wise multiply) -const assert = require('assert'), math = require('../../../src/index'), approx = require('../../../tools/approx'), error = require('../../../src/error/index'), dotMultiply = math.dotMultiply, divide = math.divide, matrix = math.matrix, sparse = math.sparse, complex = math.complex, range = math.range, i = math.i, unit = math.unit +const assert = require('assert'), math = require('../../../src/main'), approx = require('../../../tools/approx'), error = require('../../../src/error/index'), dotMultiply = math.dotMultiply, divide = math.divide, matrix = math.matrix, sparse = math.sparse, complex = math.complex, range = math.range, i = math.i, unit = math.unit describe('dotMultiply', function () { it('should multiply 2 numbers', function () { diff --git a/test/function/arithmetic/dotPow.test.js b/test/function/arithmetic/dotPow.test.js index fa5565bd5..3f76af10d 100644 --- a/test/function/arithmetic/dotPow.test.js +++ b/test/function/arithmetic/dotPow.test.js @@ -1,5 +1,5 @@ // test exp -const assert = require('assert'), approx = require('../../../tools/approx'), math = require('../../../src/index'), complex = math.complex, matrix = math.matrix, sparse = math.sparse, unit = math.unit, dotPow = math.dotPow +const assert = require('assert'), approx = require('../../../tools/approx'), math = require('../../../src/main'), complex = math.complex, matrix = math.matrix, sparse = math.sparse, unit = math.unit, dotPow = math.dotPow describe('dotPow', function () { it('should elevate a number to the given power', function () { diff --git a/test/function/arithmetic/exp.test.js b/test/function/arithmetic/exp.test.js index 11c9e6971..6e6a7ff3c 100644 --- a/test/function/arithmetic/exp.test.js +++ b/test/function/arithmetic/exp.test.js @@ -1,5 +1,5 @@ // test exp -const assert = require('assert'), approx = require('../../../tools/approx'), math = require('../../../src/index'), complex = math.complex, matrix = math.matrix, sparse = math.sparse, unit = math.unit, exp = math.exp +const assert = require('assert'), approx = require('../../../tools/approx'), math = require('../../../src/main'), complex = math.complex, matrix = math.matrix, sparse = math.sparse, unit = math.unit, exp = math.exp describe('exp', function () { it('should exponentiate a boolean', function () { diff --git a/test/function/arithmetic/expm1.test.js b/test/function/arithmetic/expm1.test.js index d4d378f40..25f669cb6 100644 --- a/test/function/arithmetic/expm1.test.js +++ b/test/function/arithmetic/expm1.test.js @@ -1,5 +1,5 @@ // test expm1 -const assert = require('assert'), approx = require('../../../tools/approx'), math = require('../../../src/index'), complex = math.complex, matrix = math.matrix, sparse = math.sparse, unit = math.unit, expm1 = math.expm1 +const assert = require('assert'), approx = require('../../../tools/approx'), math = require('../../../src/main'), complex = math.complex, matrix = math.matrix, sparse = math.sparse, unit = math.unit, expm1 = math.expm1 describe('expm1', function () { it('should exponentiate a boolean', function () { diff --git a/test/function/arithmetic/fix.test.js b/test/function/arithmetic/fix.test.js index 3a5befbed..dd67030d3 100644 --- a/test/function/arithmetic/fix.test.js +++ b/test/function/arithmetic/fix.test.js @@ -1,7 +1,7 @@ // test fix const assert = require('assert') const approx = require('../../../tools/approx') -const math = require('../../../src/index') +const math = require('../../../src/main') const bignumber = math.bignumber const complex = math.complex const fraction = math.fraction diff --git a/test/function/arithmetic/floor.test.js b/test/function/arithmetic/floor.test.js index 949bb830a..8130c9bad 100644 --- a/test/function/arithmetic/floor.test.js +++ b/test/function/arithmetic/floor.test.js @@ -1,7 +1,7 @@ // test floor const assert = require('assert') const approx = require('../../../tools/approx') -const math = require('../../../src/index') +const math = require('../../../src/main') const bignumber = math.bignumber const complex = math.complex const fraction = math.fraction diff --git a/test/function/arithmetic/gcd.test.js b/test/function/arithmetic/gcd.test.js index 4d474b847..a6e3bb2b8 100644 --- a/test/function/arithmetic/gcd.test.js +++ b/test/function/arithmetic/gcd.test.js @@ -1,5 +1,5 @@ // test gcd -const assert = require('assert'), math = require('../../../src/index'), matrix = math.matrix, sparse = math.sparse, gcd = math.gcd +const assert = require('assert'), math = require('../../../src/main'), matrix = math.matrix, sparse = math.sparse, gcd = math.gcd describe('gcd', function () { it('should find the greatest common divisor of two or more numbers', function () { diff --git a/test/function/arithmetic/hypot.test.js b/test/function/arithmetic/hypot.test.js index f469a56d3..e55f38fb7 100644 --- a/test/function/arithmetic/hypot.test.js +++ b/test/function/arithmetic/hypot.test.js @@ -1,7 +1,7 @@ // test hypot const assert = require('assert') const approx = require('../../../tools/approx') -const math = require('../../../src/index') +const math = require('../../../src/main') const hypot = math.hypot const bignumber = math.bignumber const fraction = math.fraction diff --git a/test/function/arithmetic/lcm.test.js b/test/function/arithmetic/lcm.test.js index 8dd1d4ed1..891515139 100644 --- a/test/function/arithmetic/lcm.test.js +++ b/test/function/arithmetic/lcm.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), math = require('../../../src/index'), matrix = math.matrix, sparse = math.sparse, lcm = math.lcm +const assert = require('assert'), math = require('../../../src/main'), matrix = math.matrix, sparse = math.sparse, lcm = math.lcm describe('lcm', function () { it('should find the lowest common multiple of two or more numbers', function () { diff --git a/test/function/arithmetic/log.test.js b/test/function/arithmetic/log.test.js index b203f4a97..b610ae9e3 100644 --- a/test/function/arithmetic/log.test.js +++ b/test/function/arithmetic/log.test.js @@ -2,7 +2,7 @@ const assert = require('assert') const approx = require('../../../tools/approx') const error = require('../../../src/error/index') -const math = require('../../../src/index') +const math = require('../../../src/main') const mathPredictable = math.create({predictable: true}) const complex = math.complex const matrix = math.matrix diff --git a/test/function/arithmetic/log10.test.js b/test/function/arithmetic/log10.test.js index afe0bd049..309773128 100644 --- a/test/function/arithmetic/log10.test.js +++ b/test/function/arithmetic/log10.test.js @@ -1,7 +1,7 @@ // test exp const assert = require('assert') const approx = require('../../../tools/approx') -const math = require('../../../src/index') +const math = require('../../../src/main') const mathPredictable = math.create({predictable: true}) const complex = math.complex const matrix = math.matrix diff --git a/test/function/arithmetic/log1p.test.js b/test/function/arithmetic/log1p.test.js index 9e6ae3340..1b72c5f7f 100644 --- a/test/function/arithmetic/log1p.test.js +++ b/test/function/arithmetic/log1p.test.js @@ -2,7 +2,7 @@ const assert = require('assert') const approx = require('../../../tools/approx') const error = require('../../../src/error/index') -const math = require('../../../src/index') +const math = require('../../../src/main') const mathPredictable = math.create({predictable: true}) const complex = math.complex const matrix = math.matrix diff --git a/test/function/arithmetic/log2.test.js b/test/function/arithmetic/log2.test.js index c0f31a66e..0a0ce6886 100644 --- a/test/function/arithmetic/log2.test.js +++ b/test/function/arithmetic/log2.test.js @@ -1,7 +1,7 @@ // test exp const assert = require('assert') const approx = require('../../../tools/approx') -const math = require('../../../src/index') +const math = require('../../../src/main') const mathPredictable = math.create({predictable: true}) const complex = math.complex const matrix = math.matrix diff --git a/test/function/arithmetic/mod.test.js b/test/function/arithmetic/mod.test.js index 60de190de..53472d875 100644 --- a/test/function/arithmetic/mod.test.js +++ b/test/function/arithmetic/mod.test.js @@ -1,7 +1,7 @@ // test mod const assert = require('assert') const approx = require('../../../tools/approx') -const math = require('../../../src/index') +const math = require('../../../src/main') const bignumber = math.bignumber const matrix = math.matrix const sparse = math.sparse diff --git a/test/function/arithmetic/multiply.test.js b/test/function/arithmetic/multiply.test.js index d2ebd1651..04f816e30 100644 --- a/test/function/arithmetic/multiply.test.js +++ b/test/function/arithmetic/multiply.test.js @@ -1,5 +1,5 @@ // test multiply -const assert = require('assert'), math = require('../../../src/index'), approx = require('../../../tools/approx'), multiply = math.multiply, divide = math.divide, matrix = math.matrix, complex = math.complex, bignumber = math.bignumber, i = math.i, unit = math.unit +const assert = require('assert'), math = require('../../../src/main'), approx = require('../../../tools/approx'), multiply = math.multiply, divide = math.divide, matrix = math.matrix, complex = math.complex, bignumber = math.bignumber, i = math.i, unit = math.unit describe('multiply', function () { describe('Scalar', function () { diff --git a/test/function/arithmetic/norm.test.js b/test/function/arithmetic/norm.test.js index 05bb2f8cb..2c8c00e32 100644 --- a/test/function/arithmetic/norm.test.js +++ b/test/function/arithmetic/norm.test.js @@ -1,5 +1,5 @@ // test norm -const assert = require('assert'), math = require('../../../src/index') +const assert = require('assert'), math = require('../../../src/main') describe('norm', function () { it('should return the absolute value of a boolean', function () { diff --git a/test/function/arithmetic/nthRoot.test.js b/test/function/arithmetic/nthRoot.test.js index e47a28147..d3670a0a8 100644 --- a/test/function/arithmetic/nthRoot.test.js +++ b/test/function/arithmetic/nthRoot.test.js @@ -1,7 +1,7 @@ // test nthRoot const assert = require('assert') const approx = require('../../../tools/approx') -const math = require('../../../src/index') +const math = require('../../../src/main') const matrix = math.matrix const sparse = math.sparse const unit = math.unit diff --git a/test/function/arithmetic/nthRoots.test.js b/test/function/arithmetic/nthRoots.test.js index 27f40d381..17d5336f6 100644 --- a/test/function/arithmetic/nthRoots.test.js +++ b/test/function/arithmetic/nthRoots.test.js @@ -1,6 +1,6 @@ // test nthRoots const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') const complex = math.complex const nthRoots = math.nthRoots diff --git a/test/function/arithmetic/pow.test.js b/test/function/arithmetic/pow.test.js index dbc785b5d..2e4f7bf80 100644 --- a/test/function/arithmetic/pow.test.js +++ b/test/function/arithmetic/pow.test.js @@ -2,7 +2,7 @@ const assert = require('assert') const approx = require('../../../tools/approx') const error = require('../../../src/error/index') -const math = require('../../../src/index') +const math = require('../../../src/main') const mathPredictable = math.create({predictable: true}) const bignumber = math.bignumber const fraction = math.fraction diff --git a/test/function/arithmetic/round.test.js b/test/function/arithmetic/round.test.js index c6cfe60ec..7554b186b 100644 --- a/test/function/arithmetic/round.test.js +++ b/test/function/arithmetic/round.test.js @@ -1,7 +1,7 @@ // test round const assert = require('assert') const approx = require('../../../tools/approx') -const math = require('../../../src/index') +const math = require('../../../src/main') const bignumber = math.bignumber const fraction = math.fraction const matrix = math.matrix diff --git a/test/function/arithmetic/sign.test.js b/test/function/arithmetic/sign.test.js index 89c3cd406..f512b784c 100644 --- a/test/function/arithmetic/sign.test.js +++ b/test/function/arithmetic/sign.test.js @@ -1,7 +1,7 @@ // test sign const assert = require('assert') const approx = require('../../../tools/approx') -const math = require('../../../src/index') +const math = require('../../../src/main') const bignumber = math.bignumber const fraction = math.fraction const complex = math.complex diff --git a/test/function/arithmetic/sqrt.test.js b/test/function/arithmetic/sqrt.test.js index 3e44f933b..443840b4d 100644 --- a/test/function/arithmetic/sqrt.test.js +++ b/test/function/arithmetic/sqrt.test.js @@ -2,7 +2,7 @@ const assert = require('assert') const approx = require('../../../tools/approx') const error = require('../../../src/error/index') -const math = require('../../../src/index') +const math = require('../../../src/main') const mathPredictable = math.create({predictable: true}) const sqrt = math.sqrt const bignumber = math.bignumber diff --git a/test/function/arithmetic/square.test.js b/test/function/arithmetic/square.test.js index d383f4d9b..9c591c32a 100644 --- a/test/function/arithmetic/square.test.js +++ b/test/function/arithmetic/square.test.js @@ -1,6 +1,6 @@ // test square const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') const unit = math.unit const bignumber = math.bignumber const fraction = math.fraction diff --git a/test/function/arithmetic/subtract.test.js b/test/function/arithmetic/subtract.test.js index c61eeebdd..677c473af 100644 --- a/test/function/arithmetic/subtract.test.js +++ b/test/function/arithmetic/subtract.test.js @@ -1,7 +1,7 @@ // test subtract const assert = require('assert') const approx = require('../../../tools/approx') -const math = require('../../../src/index') +const math = require('../../../src/main') const bignumber = math.bignumber const subtract = math.subtract diff --git a/test/function/arithmetic/unaryMinus.test.js b/test/function/arithmetic/unaryMinus.test.js index 711d3c14f..fe898c90f 100644 --- a/test/function/arithmetic/unaryMinus.test.js +++ b/test/function/arithmetic/unaryMinus.test.js @@ -1,6 +1,6 @@ // test unary minus const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') const bignumber = math.bignumber const fraction = math.fraction const complex = math.complex diff --git a/test/function/arithmetic/unaryPlus.test.js b/test/function/arithmetic/unaryPlus.test.js index c1f97ec15..0335d0c99 100644 --- a/test/function/arithmetic/unaryPlus.test.js +++ b/test/function/arithmetic/unaryPlus.test.js @@ -1,6 +1,6 @@ // test unary plus const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') const error = require('../../../src/error/index') const bignumber = math.bignumber const fraction = math.fraction diff --git a/test/function/arithmetic/xgcd.test.js b/test/function/arithmetic/xgcd.test.js index 4f349d152..66825ccf4 100644 --- a/test/function/arithmetic/xgcd.test.js +++ b/test/function/arithmetic/xgcd.test.js @@ -1,5 +1,5 @@ // test xgcd -const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/index').create({matrix: 'Array'}), gcd = math.gcd, xgcd = math.xgcd +const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/main').create({matrix: 'Array'}), gcd = math.gcd, xgcd = math.xgcd describe('xgcd', function () { it('should return extended greatest common divisor of two numbers', function () { diff --git a/test/function/bitwise/bitAnd.test.js b/test/function/bitwise/bitAnd.test.js index 728568650..d84db707e 100644 --- a/test/function/bitwise/bitAnd.test.js +++ b/test/function/bitwise/bitAnd.test.js @@ -1,5 +1,5 @@ // test bitAnd -const assert = require('assert'), math = require('../../../src/index'), bignumber = math.bignumber, bitAnd = math.bitAnd +const assert = require('assert'), math = require('../../../src/main'), bignumber = math.bignumber, bitAnd = math.bitAnd describe('bitAnd', function () { it('should bitwise and two numbers', function () { diff --git a/test/function/bitwise/bitNot.test.js b/test/function/bitwise/bitNot.test.js index eb588859d..d2ef80d6f 100644 --- a/test/function/bitwise/bitNot.test.js +++ b/test/function/bitwise/bitNot.test.js @@ -1,5 +1,5 @@ // test bitNot -const assert = require('assert'), math = require('../../../src/index'), bignumber = math.bignumber, bitNot = math.bitNot +const assert = require('assert'), math = require('../../../src/main'), bignumber = math.bignumber, bitNot = math.bitNot describe('bitNot', function () { it('should return bitwise not of a boolean', function () { diff --git a/test/function/bitwise/bitOr.test.js b/test/function/bitwise/bitOr.test.js index 34f845e21..5ce0090cf 100644 --- a/test/function/bitwise/bitOr.test.js +++ b/test/function/bitwise/bitOr.test.js @@ -1,5 +1,5 @@ // test bitOr -const assert = require('assert'), math = require('../../../src/index'), bignumber = math.bignumber, bitOr = math.bitOr +const assert = require('assert'), math = require('../../../src/main'), bignumber = math.bignumber, bitOr = math.bitOr describe('bitOr', function () { it('should bitwise or two numbers', function () { diff --git a/test/function/bitwise/bitXor.test.js b/test/function/bitwise/bitXor.test.js index 4f45885a3..017c4738e 100644 --- a/test/function/bitwise/bitXor.test.js +++ b/test/function/bitwise/bitXor.test.js @@ -1,5 +1,5 @@ // test bitXor -const assert = require('assert'), math = require('../../../src/index'), matrix = math.matrix, sparse = math.sparse, bignumber = math.bignumber, bitXor = math.bitXor +const assert = require('assert'), math = require('../../../src/main'), matrix = math.matrix, sparse = math.sparse, bignumber = math.bignumber, bitXor = math.bitXor describe('bitXor', function () { it('should xor two numbers', function () { diff --git a/test/function/bitwise/leftShift.test.js b/test/function/bitwise/leftShift.test.js index eaa2302f9..4e30452be 100644 --- a/test/function/bitwise/leftShift.test.js +++ b/test/function/bitwise/leftShift.test.js @@ -1,5 +1,5 @@ // test leftShift -const assert = require('assert'), math = require('../../../src/index'), matrix = math.matrix, sparse = math.sparse, bignumber = math.bignumber, leftShift = math.leftShift +const assert = require('assert'), math = require('../../../src/main'), matrix = math.matrix, sparse = math.sparse, bignumber = math.bignumber, leftShift = math.leftShift describe('leftShift', function () { it('should left shift a number by a given amount', function () { diff --git a/test/function/bitwise/rightArithShift.test.js b/test/function/bitwise/rightArithShift.test.js index f909e6b91..bd2b827c1 100644 --- a/test/function/bitwise/rightArithShift.test.js +++ b/test/function/bitwise/rightArithShift.test.js @@ -1,5 +1,5 @@ // test rightArithShift -const assert = require('assert'), math = require('../../../src/index'), matrix = math.matrix, sparse = math.sparse, bignumber = math.bignumber, rightArithShift = math.rightArithShift +const assert = require('assert'), math = require('../../../src/main'), matrix = math.matrix, sparse = math.sparse, bignumber = math.bignumber, rightArithShift = math.rightArithShift describe('rightArithShift', function () { it('should right arithmetically shift a number by a given amount', function () { diff --git a/test/function/bitwise/rightLogShift.test.js b/test/function/bitwise/rightLogShift.test.js index d68b91ac6..3e9a8416a 100644 --- a/test/function/bitwise/rightLogShift.test.js +++ b/test/function/bitwise/rightLogShift.test.js @@ -1,5 +1,5 @@ // test rightLogShift -const assert = require('assert'), math = require('../../../src/index'), matrix = math.matrix, sparse = math.sparse, rightLogShift = math.rightLogShift +const assert = require('assert'), math = require('../../../src/main'), matrix = math.matrix, sparse = math.sparse, rightLogShift = math.rightLogShift describe('rightLogShift', function () { it('should right logically shift a number by a given amount', function () { diff --git a/test/function/combinatorics/bellNumbers.test.js b/test/function/combinatorics/bellNumbers.test.js index 977d6c62f..ee26fa9d2 100644 --- a/test/function/combinatorics/bellNumbers.test.js +++ b/test/function/combinatorics/bellNumbers.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/index'), bellNumbers = math.bellNumbers +const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/main'), bellNumbers = math.bellNumbers describe('bellNumbers', function () { it('should calculate the number of partitions of a set', function () { diff --git a/test/function/combinatorics/catalan.test.js b/test/function/combinatorics/catalan.test.js index 2c613f293..04c9eea20 100644 --- a/test/function/combinatorics/catalan.test.js +++ b/test/function/combinatorics/catalan.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/index'), catalan = math.catalan +const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/main'), catalan = math.catalan describe('catalan', function () { it('should calculate the nth catalan number', function () { diff --git a/test/function/combinatorics/composition.test.js b/test/function/combinatorics/composition.test.js index 6d308aee2..7bf99944e 100644 --- a/test/function/combinatorics/composition.test.js +++ b/test/function/combinatorics/composition.test.js @@ -1,6 +1,6 @@ const assert = require('assert') const error = require('../../../src/error/index') -const math = require('../../../src/index') +const math = require('../../../src/main') const composition = math.composition describe('composition', function () { diff --git a/test/function/combinatorics/stirlingS2.test.js b/test/function/combinatorics/stirlingS2.test.js index 5f1da3ceb..114ea038f 100644 --- a/test/function/combinatorics/stirlingS2.test.js +++ b/test/function/combinatorics/stirlingS2.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/index'), stirlingS2 = math.stirlingS2 +const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/main'), stirlingS2 = math.stirlingS2 describe('stirlingS2', function () { it('should calculate the number of ways to partition a set of n objects into k non-empty subsets', function () { diff --git a/test/function/complex/arg.test.js b/test/function/complex/arg.test.js index 131d3bd67..673b2f69a 100644 --- a/test/function/complex/arg.test.js +++ b/test/function/complex/arg.test.js @@ -1,6 +1,6 @@ const assert = require('assert') const approx = require('../../../tools/approx') -const math = require('../../../src/index') +const math = require('../../../src/main') const arg = math.arg describe('arg', function () { diff --git a/test/function/complex/conj.test.js b/test/function/complex/conj.test.js index 34484a725..4f17f5cb6 100644 --- a/test/function/complex/conj.test.js +++ b/test/function/complex/conj.test.js @@ -1,5 +1,5 @@ const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') const conj = math.conj describe('conj', function () { diff --git a/test/function/complex/im.test.js b/test/function/complex/im.test.js index 68a5dc332..2e8b7e6e6 100644 --- a/test/function/complex/im.test.js +++ b/test/function/complex/im.test.js @@ -1,5 +1,5 @@ const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') describe('im', function () { it('should return the imaginary part of a complex number', function () { diff --git a/test/function/complex/re.test.js b/test/function/complex/re.test.js index 1cbb1710f..f3ae2316b 100644 --- a/test/function/complex/re.test.js +++ b/test/function/complex/re.test.js @@ -1,5 +1,5 @@ const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') describe('re', function () { it('should return the real part of a complex number', function () { diff --git a/test/function/geometry/distance.test.js b/test/function/geometry/distance.test.js index 89dcacb0a..2dd3630d0 100644 --- a/test/function/geometry/distance.test.js +++ b/test/function/geometry/distance.test.js @@ -1,6 +1,6 @@ const assert = require('assert') const error = require('../../../src/error/index') -const math = require('../../../src/index') +const math = require('../../../src/main') describe('distance', function () { it('should calculate the distance of two 2D points', function () { diff --git a/test/function/geometry/intersect.test.js b/test/function/geometry/intersect.test.js index 487fa32cd..bb69fe6a1 100644 --- a/test/function/geometry/intersect.test.js +++ b/test/function/geometry/intersect.test.js @@ -1,6 +1,6 @@ const assert = require('assert') const error = require('../../../src/error/index') -const math = require('../../../src/index') +const math = require('../../../src/main') describe('intersect', function () { it('should calculate the intersection point of two 2D lines', function () { diff --git a/test/function/logical/and.test.js b/test/function/logical/and.test.js index 1c89df88e..64c109bd5 100644 --- a/test/function/logical/and.test.js +++ b/test/function/logical/and.test.js @@ -1,5 +1,5 @@ // test and -const assert = require('assert'), math = require('../../../src/index'), bignumber = math.bignumber, complex = math.complex, matrix = math.matrix, sparse = math.sparse, unit = math.unit, and = math.and +const assert = require('assert'), math = require('../../../src/main'), bignumber = math.bignumber, complex = math.complex, matrix = math.matrix, sparse = math.sparse, unit = math.unit, and = math.and describe('and', function () { it('should and two numbers correctly', function () { diff --git a/test/function/logical/not.test.js b/test/function/logical/not.test.js index 5ff7bd933..e10dbf55f 100644 --- a/test/function/logical/not.test.js +++ b/test/function/logical/not.test.js @@ -1,6 +1,6 @@ // test not const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') const bignumber = math.bignumber const complex = math.complex const matrix = math.matrix diff --git a/test/function/logical/or.test.js b/test/function/logical/or.test.js index a573e9351..e9e112b73 100644 --- a/test/function/logical/or.test.js +++ b/test/function/logical/or.test.js @@ -1,5 +1,5 @@ // test or -const assert = require('assert'), math = require('../../../src/index'), bignumber = math.bignumber, complex = math.complex, matrix = math.matrix, sparse = math.sparse, unit = math.unit, or = math.or +const assert = require('assert'), math = require('../../../src/main'), bignumber = math.bignumber, complex = math.complex, matrix = math.matrix, sparse = math.sparse, unit = math.unit, or = math.or describe('or', function () { it('should or two numbers correctly', function () { diff --git a/test/function/logical/xor.test.js b/test/function/logical/xor.test.js index 9770143ed..36b1ea081 100644 --- a/test/function/logical/xor.test.js +++ b/test/function/logical/xor.test.js @@ -1,5 +1,5 @@ // test xor -const assert = require('assert'), math = require('../../../src/index'), bignumber = math.bignumber, complex = math.complex, matrix = math.matrix, sparse = math.sparse, unit = math.unit, xor = math.xor +const assert = require('assert'), math = require('../../../src/main'), bignumber = math.bignumber, complex = math.complex, matrix = math.matrix, sparse = math.sparse, unit = math.unit, xor = math.xor describe('xor', function () { it('should xor two numbers correctly', function () { diff --git a/test/function/matrix/concat.test.js b/test/function/matrix/concat.test.js index ec3034a69..e17b73fb8 100644 --- a/test/function/matrix/concat.test.js +++ b/test/function/matrix/concat.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/index'), bignumber = math.bignumber +const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/main'), bignumber = math.bignumber describe('concat', function () { const a = [[1, 2], [3, 4]] diff --git a/test/function/matrix/cross.test.js b/test/function/matrix/cross.test.js index 99adcfd81..3292d364a 100644 --- a/test/function/matrix/cross.test.js +++ b/test/function/matrix/cross.test.js @@ -1,6 +1,6 @@ const assert = require('assert') const error = require('../../../src/error/index') -const math = require('../../../src/index') +const math = require('../../../src/main') describe('cross', function () { it('should calculate cross product for two arrays', function () { diff --git a/test/function/matrix/ctranspose.test.js b/test/function/matrix/ctranspose.test.js index e0027fcdf..5bf3d0a7b 100644 --- a/test/function/matrix/ctranspose.test.js +++ b/test/function/matrix/ctranspose.test.js @@ -1,5 +1,5 @@ // test transpose -const assert = require('assert'), math = require('../../../src/index'), ctranspose = math.ctranspose +const assert = require('assert'), math = require('../../../src/main'), ctranspose = math.ctranspose describe('ctranspose', function () { it('should transpose a real scalar', function () { diff --git a/test/function/matrix/det.test.js b/test/function/matrix/det.test.js index 0ae616c71..f108ebb10 100644 --- a/test/function/matrix/det.test.js +++ b/test/function/matrix/det.test.js @@ -1,7 +1,7 @@ const assert = require('assert') const approx = require('../../../tools/approx') const error = require('../../../src/error/index') -const math = require('../../../src/index') +const math = require('../../../src/main') const BigNumber = math.type.BigNumber const Complex = math.type.Complex const DenseMatrix = math.type.DenseMatrix diff --git a/test/function/matrix/diag.test.js b/test/function/matrix/diag.test.js index ecf5780c2..ea91b697a 100644 --- a/test/function/matrix/diag.test.js +++ b/test/function/matrix/diag.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), math = require('../../../src/index'), bignumber = math.bignumber +const assert = require('assert'), math = require('../../../src/main'), bignumber = math.bignumber describe('diag', function () { it('should return a diagonal matrix on the default diagonal', function () { diff --git a/test/function/matrix/dot.test.js b/test/function/matrix/dot.test.js index f533ce29f..75bbfddf3 100644 --- a/test/function/matrix/dot.test.js +++ b/test/function/matrix/dot.test.js @@ -1,6 +1,6 @@ const assert = require('assert') const error = require('../../../src/error/index') -const math = require('../../../src/index') +const math = require('../../../src/main') describe('dot', function () { it('should calculate dot product for two arrays', function () { diff --git a/test/function/matrix/expm.test.js b/test/function/matrix/expm.test.js index a64953e70..eab7a952d 100644 --- a/test/function/matrix/expm.test.js +++ b/test/function/matrix/expm.test.js @@ -1,7 +1,7 @@ // test expm const assert = require('assert') const approx = require('../../../tools/approx') -const math = require('../../../src/index') +const math = require('../../../src/main') const expm = math.expm describe('expm', function () { diff --git a/test/function/matrix/filter.test.js b/test/function/matrix/filter.test.js index c4b9b83e3..d42c6a9f4 100644 --- a/test/function/matrix/filter.test.js +++ b/test/function/matrix/filter.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/index') +const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/main') describe('filter', function () { it('should filter an array with a filter function', function () { diff --git a/test/function/matrix/flatten.test.js b/test/function/matrix/flatten.test.js index 45e407c63..f45f62199 100644 --- a/test/function/matrix/flatten.test.js +++ b/test/function/matrix/flatten.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/index'), matrix = math.matrix, flatten = math.flatten +const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/main'), matrix = math.matrix, flatten = math.flatten describe('flatten', function () { it('should flatten an empty array', function () { diff --git a/test/function/matrix/forEach.test.js b/test/function/matrix/forEach.test.js index 9d4a19df2..f241e6474 100644 --- a/test/function/matrix/forEach.test.js +++ b/test/function/matrix/forEach.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/index') +const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/main') describe('forEach', function () { it('should iterate over all elements of the matrix', function () { diff --git a/test/function/matrix/identity.test.js b/test/function/matrix/identity.test.js index 41e67645f..13f29a126 100644 --- a/test/function/matrix/identity.test.js +++ b/test/function/matrix/identity.test.js @@ -1,5 +1,5 @@ const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') const matrix = math.matrix const identity = math.identity diff --git a/test/function/matrix/inv.test.js b/test/function/matrix/inv.test.js index 9b49e0025..a1da1b21f 100644 --- a/test/function/matrix/inv.test.js +++ b/test/function/matrix/inv.test.js @@ -1,5 +1,5 @@ // test inv -const assert = require('assert'), approx = require('../../../tools/approx'), error = require('../../../src/error/index'), math = require('../../../src/index'), inv = math.inv +const assert = require('assert'), approx = require('../../../tools/approx'), error = require('../../../src/error/index'), math = require('../../../src/main'), inv = math.inv describe('inv', function () { it('should return the inverse of a number', function () { diff --git a/test/function/matrix/kron.test.js b/test/function/matrix/kron.test.js index 434eda656..c15991dcc 100644 --- a/test/function/matrix/kron.test.js +++ b/test/function/matrix/kron.test.js @@ -1,5 +1,5 @@ // test kronecker product -const assert = require('assert'), math = require('../../../src/index') +const assert = require('assert'), math = require('../../../src/main') describe('kron', function () { it('should calculate the kronecker product of two arrays', function () { diff --git a/test/function/matrix/map.test.js b/test/function/matrix/map.test.js index 68c0a4120..0436eab72 100644 --- a/test/function/matrix/map.test.js +++ b/test/function/matrix/map.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/index') +const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/main') describe('map', function () { it('should apply map to all elements of the matrix', function () { diff --git a/test/function/matrix/ones.test.js b/test/function/matrix/ones.test.js index d171e5d1d..ea3e6eb19 100644 --- a/test/function/matrix/ones.test.js +++ b/test/function/matrix/ones.test.js @@ -1,5 +1,5 @@ // test ones -const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/index'), ones = math.ones, matrix = math.matrix +const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/main'), ones = math.ones, matrix = math.matrix describe('ones', function () { it('should create an empty matrix', function () { diff --git a/test/function/matrix/partitionSelect.test.js b/test/function/matrix/partitionSelect.test.js index b69bd3626..7aa338f97 100644 --- a/test/function/matrix/partitionSelect.test.js +++ b/test/function/matrix/partitionSelect.test.js @@ -1,6 +1,6 @@ const assert = require('assert') const error = require('../../../src/error/index') -const math = require('../../../src/index') +const math = require('../../../src/main') const matrix = math.matrix const partitionSelect = math.partitionSelect diff --git a/test/function/matrix/range.test.js b/test/function/matrix/range.test.js index 2346c0853..ae1bdcf5f 100644 --- a/test/function/matrix/range.test.js +++ b/test/function/matrix/range.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), approx = require('../../../tools/approx'), error = require('../../../src/error/index'), math = require('../../../src/index'), range = math.range, matrix = math.matrix, bignumber = math.bignumber +const assert = require('assert'), approx = require('../../../tools/approx'), error = require('../../../src/error/index'), math = require('../../../src/main'), range = math.range, matrix = math.matrix, bignumber = math.bignumber describe('range', function () { it('should parse a valid string correctly', function () { diff --git a/test/function/matrix/reshape.test.js b/test/function/matrix/reshape.test.js index 88622afaf..c0811bd81 100644 --- a/test/function/matrix/reshape.test.js +++ b/test/function/matrix/reshape.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/index'), Matrix = math.type.Matrix +const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/main'), Matrix = math.type.Matrix describe('reshape', function () { it('should reshape an array', function () { diff --git a/test/function/matrix/resize.test.js b/test/function/matrix/resize.test.js index a8f7efbcf..a95d06cf7 100644 --- a/test/function/matrix/resize.test.js +++ b/test/function/matrix/resize.test.js @@ -1,5 +1,5 @@ // test resize -const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/index'), Matrix = math.type.Matrix +const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/main'), Matrix = math.type.Matrix describe('resize', function () { it('should resize an array', function () { diff --git a/test/function/matrix/size.test.js b/test/function/matrix/size.test.js index caab4c9d7..63f2badaa 100644 --- a/test/function/matrix/size.test.js +++ b/test/function/matrix/size.test.js @@ -1,5 +1,5 @@ // test size -const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/index'), size = math.size, matrix = math.matrix +const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/main'), size = math.size, matrix = math.matrix describe('size', function () { it('should calculate the size of an array', function () { diff --git a/test/function/matrix/sort.test.js b/test/function/matrix/sort.test.js index 0535ea3ae..09f61521b 100644 --- a/test/function/matrix/sort.test.js +++ b/test/function/matrix/sort.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/index') +const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/main') describe('sort', function () { it('should sort an array with numbers', function () { diff --git a/test/function/matrix/sqrtm.test.js b/test/function/matrix/sqrtm.test.js index 1e72cf1e2..9561a888e 100644 --- a/test/function/matrix/sqrtm.test.js +++ b/test/function/matrix/sqrtm.test.js @@ -1,5 +1,5 @@ // test sqrtm -const assert = require('assert'), approx = require('../../../tools/approx'), math = require('../../../src/index') +const assert = require('assert'), approx = require('../../../tools/approx'), math = require('../../../src/main') describe('sqrtm', function () { const A = [[5, 2], [4, 7]] diff --git a/test/function/matrix/squeeze.test.js b/test/function/matrix/squeeze.test.js index a6c81f04d..a917a67ac 100644 --- a/test/function/matrix/squeeze.test.js +++ b/test/function/matrix/squeeze.test.js @@ -1,5 +1,5 @@ // test squeeze -const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/index'), squeeze = math.squeeze, size = math.size, matrix = math.matrix +const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/main'), squeeze = math.squeeze, size = math.size, matrix = math.matrix describe('squeeze', function () { it('should squeeze an matrix', function () { diff --git a/test/function/matrix/subset.test.js b/test/function/matrix/subset.test.js index d7f99f033..90eb64dcc 100644 --- a/test/function/matrix/subset.test.js +++ b/test/function/matrix/subset.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), math = require('../../../src/index'), subset = math.subset, matrix = math.matrix, Range = math.type.Range, Set = math.type.Set, index = math.index +const assert = require('assert'), math = require('../../../src/main'), subset = math.subset, matrix = math.matrix, Range = math.type.Range, Set = math.type.Set, index = math.index describe('subset', function () { const a = [[1, 2], [3, 4]] diff --git a/test/function/matrix/trace.test.js b/test/function/matrix/trace.test.js index 6750ebaca..8eeec4a54 100644 --- a/test/function/matrix/trace.test.js +++ b/test/function/matrix/trace.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), approx = require('../../../tools/approx'), math = require('../../../src/index') +const assert = require('assert'), approx = require('../../../tools/approx'), math = require('../../../src/main') describe('trace', function () { it('should calculate correctly the trace of a NxN array', function () { diff --git a/test/function/matrix/transpose.test.js b/test/function/matrix/transpose.test.js index 7af5aa4d2..8721d79c8 100644 --- a/test/function/matrix/transpose.test.js +++ b/test/function/matrix/transpose.test.js @@ -1,5 +1,5 @@ // test transpose -const assert = require('assert'), math = require('../../../src/index'), transpose = math.transpose +const assert = require('assert'), math = require('../../../src/main'), transpose = math.transpose describe('transpose', function () { it('should transpose a scalar', function () { diff --git a/test/function/matrix/zeros.test.js b/test/function/matrix/zeros.test.js index c34430404..1a5882bd0 100644 --- a/test/function/matrix/zeros.test.js +++ b/test/function/matrix/zeros.test.js @@ -1,5 +1,5 @@ // test zeros -const assert = require('assert'), math = require('../../../src/index'), zeros = math.zeros, matrix = math.matrix +const assert = require('assert'), math = require('../../../src/main'), zeros = math.zeros, matrix = math.matrix describe('zeros', function () { it('should create an empty matrix', function () { diff --git a/test/function/probability/combinations.test.js b/test/function/probability/combinations.test.js index 024983ba5..eebc1374e 100644 --- a/test/function/probability/combinations.test.js +++ b/test/function/probability/combinations.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/index'), combinations = math.combinations +const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/main'), combinations = math.combinations describe('combinations', function () { it('should calculate the combinations of a number taking k at a time', function () { diff --git a/test/function/probability/distribution.test.js b/test/function/probability/distribution.test.js index a6532c528..4de632d74 100644 --- a/test/function/probability/distribution.test.js +++ b/test/function/probability/distribution.test.js @@ -1,7 +1,7 @@ const assert = require('assert') const error = require('../../../src/error/index') const _ = require('underscore') -const math = require('../../../src/index') +const math = require('../../../src/main') math.import(require('../../../src/function/probability/distribution')) const Matrix = math.type.Matrix diff --git a/test/function/probability/factorial.test.js b/test/function/probability/factorial.test.js index f39a4ab82..0eb639675 100644 --- a/test/function/probability/factorial.test.js +++ b/test/function/probability/factorial.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), approx = require('../../../tools/approx'), error = require('../../../src/error/index'), math = require('../../../src/index'), factorial = math.factorial +const assert = require('assert'), approx = require('../../../tools/approx'), error = require('../../../src/error/index'), math = require('../../../src/main'), factorial = math.factorial describe('factorial', function () { it('should calculate the factorial of a number', function () { diff --git a/test/function/probability/gamma.test.js b/test/function/probability/gamma.test.js index ca0a76d78..df17aa0de 100644 --- a/test/function/probability/gamma.test.js +++ b/test/function/probability/gamma.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), approx = require('../../../tools/approx'), error = require('../../../src/error/index'), math = require('../../../src/index'), bigUtil = require('../../../src/utils/index').bignumber, bignumber = math.bignumber, gamma = math.gamma +const assert = require('assert'), approx = require('../../../tools/approx'), error = require('../../../src/error/index'), math = require('../../../src/main'), bigUtil = require('../../../src/utils/index').bignumber, bignumber = math.bignumber, gamma = math.gamma describe('gamma', function () { it('should calculate the gamma of an integer number', function () { diff --git a/test/function/probability/kldivergence.test.js b/test/function/probability/kldivergence.test.js index 47c3592b3..72ea22c25 100644 --- a/test/function/probability/kldivergence.test.js +++ b/test/function/probability/kldivergence.test.js @@ -1,5 +1,5 @@ const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') describe('kldivergence', function () { it('should return 0, cause distributions is equals', function () { diff --git a/test/function/probability/multinomial.test.js b/test/function/probability/multinomial.test.js index 43bf2809c..727f1efad 100644 --- a/test/function/probability/multinomial.test.js +++ b/test/function/probability/multinomial.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/index'), multinomial = math.multinomial, _ = require('underscore') +const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/main'), multinomial = math.multinomial, _ = require('underscore') describe('multinomial', function () { it('should calculate the multinomial of an array of numbers', function () { diff --git a/test/function/probability/permutations.test.js b/test/function/probability/permutations.test.js index 30fcd0f54..08adc2248 100644 --- a/test/function/probability/permutations.test.js +++ b/test/function/probability/permutations.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/index'), permutations = math.permutations +const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/main'), permutations = math.permutations describe('permutations', function () { it('should calculate the permutations of a number', function () { diff --git a/test/function/probability/pickRandom.test.js b/test/function/probability/pickRandom.test.js index 504ff2d13..1179189b5 100644 --- a/test/function/probability/pickRandom.test.js +++ b/test/function/probability/pickRandom.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), math = require('../../../src/index') +const assert = require('assert'), math = require('../../../src/main') describe('pickRandom', function () { // Note: pickRandom is a convenience function generated by distribution diff --git a/test/function/probability/random.test.js b/test/function/probability/random.test.js index c12c9a959..a76dc3990 100644 --- a/test/function/probability/random.test.js +++ b/test/function/probability/random.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), math = require('../../../src/index') +const assert = require('assert'), math = require('../../../src/main') describe('random', function () { // Note: random is a convenience function generated by distribution diff --git a/test/function/probability/randomInt.test.js b/test/function/probability/randomInt.test.js index 252ae5a58..91edc9bb0 100644 --- a/test/function/probability/randomInt.test.js +++ b/test/function/probability/randomInt.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), math = require('../../../src/index') +const assert = require('assert'), math = require('../../../src/main') describe('randomInt', function () { // Note: randomInt is a convenience function generated by distribution diff --git a/test/function/probability/seededrandom.test.js b/test/function/probability/seededrandom.test.js index 2f50e36a7..229217878 100644 --- a/test/function/probability/seededrandom.test.js +++ b/test/function/probability/seededrandom.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), math = require('../../../src/index') +const assert = require('assert'), math = require('../../../src/main') describe('seed', function () { after(function () { diff --git a/test/function/relational/compare.test.js b/test/function/relational/compare.test.js index 24df1acdc..b669407f7 100644 --- a/test/function/relational/compare.test.js +++ b/test/function/relational/compare.test.js @@ -1,5 +1,5 @@ // test compare -const assert = require('assert'), math = require('../../../src/index'), bignumber = math.bignumber, complex = math.complex, matrix = math.matrix, sparse = math.sparse, unit = math.unit, compare = math.compare +const assert = require('assert'), math = require('../../../src/main'), bignumber = math.bignumber, complex = math.complex, matrix = math.matrix, sparse = math.sparse, unit = math.unit, compare = math.compare describe('compare', function () { it('should compare two numbers correctly', function () { diff --git a/test/function/relational/compareNatural.test.js b/test/function/relational/compareNatural.test.js index 456fac2f4..2287ff68b 100644 --- a/test/function/relational/compareNatural.test.js +++ b/test/function/relational/compareNatural.test.js @@ -1,6 +1,6 @@ // test compareNatural const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') const bignumber = math.bignumber const complex = math.complex const matrix = math.matrix diff --git a/test/function/relational/compareText.test.js b/test/function/relational/compareText.test.js index 64d6be891..8d39e0feb 100644 --- a/test/function/relational/compareText.test.js +++ b/test/function/relational/compareText.test.js @@ -1,6 +1,6 @@ // test compareText const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') const bignumber = math.bignumber const matrix = math.matrix const sparse = math.sparse diff --git a/test/function/relational/deepEqual.test.js b/test/function/relational/deepEqual.test.js index 135a5b929..792602cd2 100644 --- a/test/function/relational/deepEqual.test.js +++ b/test/function/relational/deepEqual.test.js @@ -1,5 +1,5 @@ // test deepEqual -const assert = require('assert'), math = require('../../../src/index'), bignumber = math.bignumber, complex = math.complex, matrix = math.matrix, unit = math.unit, deepEqual = math.deepEqual +const assert = require('assert'), math = require('../../../src/main'), bignumber = math.bignumber, complex = math.complex, matrix = math.matrix, unit = math.unit, deepEqual = math.deepEqual describe('deepEqual', function () { it('should compare scalars correctly', function () { diff --git a/test/function/relational/equal.test.js b/test/function/relational/equal.test.js index 114c0ce9e..67abf81a6 100644 --- a/test/function/relational/equal.test.js +++ b/test/function/relational/equal.test.js @@ -1,5 +1,5 @@ // test equal -const assert = require('assert'), math = require('../../../src/index'), bignumber = math.bignumber, complex = math.complex, matrix = math.matrix, sparse = math.sparse, unit = math.unit, equal = math.equal +const assert = require('assert'), math = require('../../../src/main'), bignumber = math.bignumber, complex = math.complex, matrix = math.matrix, sparse = math.sparse, unit = math.unit, equal = math.equal describe('equal', function () { it('should compare two numbers correctly', function () { diff --git a/test/function/relational/equalText.test.js b/test/function/relational/equalText.test.js index af2c8622d..007a10477 100644 --- a/test/function/relational/equalText.test.js +++ b/test/function/relational/equalText.test.js @@ -1,6 +1,6 @@ // test equalText const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') const bignumber = math.bignumber const matrix = math.matrix const sparse = math.sparse diff --git a/test/function/relational/larger.test.js b/test/function/relational/larger.test.js index 2ab42ccec..f9d08e708 100644 --- a/test/function/relational/larger.test.js +++ b/test/function/relational/larger.test.js @@ -1,5 +1,5 @@ // test larger -const assert = require('assert'), math = require('../../../src/index'), bignumber = math.bignumber, complex = math.complex, matrix = math.matrix, sparse = math.sparse, unit = math.unit, larger = math.larger +const assert = require('assert'), math = require('../../../src/main'), bignumber = math.bignumber, complex = math.complex, matrix = math.matrix, sparse = math.sparse, unit = math.unit, larger = math.larger describe('larger', function () { it('should compare two numbers correctly', function () { diff --git a/test/function/relational/largerEq.test.js b/test/function/relational/largerEq.test.js index 909c8495d..7bb19d52f 100644 --- a/test/function/relational/largerEq.test.js +++ b/test/function/relational/largerEq.test.js @@ -1,5 +1,5 @@ // test largerEq -const assert = require('assert'), math = require('../../../src/index'), bignumber = math.bignumber, complex = math.complex, matrix = math.matrix, sparse = math.sparse, unit = math.unit, largerEq = math.largerEq +const assert = require('assert'), math = require('../../../src/main'), bignumber = math.bignumber, complex = math.complex, matrix = math.matrix, sparse = math.sparse, unit = math.unit, largerEq = math.largerEq describe('largerEq', function () { it('should compare two numbers correctly', function () { diff --git a/test/function/relational/smaller.test.js b/test/function/relational/smaller.test.js index 1c9055829..920e10208 100644 --- a/test/function/relational/smaller.test.js +++ b/test/function/relational/smaller.test.js @@ -1,5 +1,5 @@ // test smaller -const assert = require('assert'), math = require('../../../src/index'), bignumber = math.bignumber, complex = math.complex, matrix = math.matrix, sparse = math.sparse, unit = math.unit, smaller = math.smaller +const assert = require('assert'), math = require('../../../src/main'), bignumber = math.bignumber, complex = math.complex, matrix = math.matrix, sparse = math.sparse, unit = math.unit, smaller = math.smaller describe('smaller', function () { it('should compare two numbers correctly', function () { diff --git a/test/function/relational/smallerEq.test.js b/test/function/relational/smallerEq.test.js index f73a5593a..e538812fd 100644 --- a/test/function/relational/smallerEq.test.js +++ b/test/function/relational/smallerEq.test.js @@ -1,5 +1,5 @@ // test smaller -const assert = require('assert'), math = require('../../../src/index'), bignumber = math.bignumber, complex = math.complex, matrix = math.matrix, sparse = math.sparse, unit = math.unit, smallerEq = math.smallerEq +const assert = require('assert'), math = require('../../../src/main'), bignumber = math.bignumber, complex = math.complex, matrix = math.matrix, sparse = math.sparse, unit = math.unit, smallerEq = math.smallerEq describe('smallerEq', function () { it('should compare two numbers correctly', function () { diff --git a/test/function/relational/unequal.test.js b/test/function/relational/unequal.test.js index 0ac4bb339..b3eb0158d 100644 --- a/test/function/relational/unequal.test.js +++ b/test/function/relational/unequal.test.js @@ -1,5 +1,5 @@ // test unequal -const assert = require('assert'), math = require('../../../src/index'), bignumber = math.bignumber, complex = math.complex, matrix = math.matrix, sparse = math.sparse, unit = math.unit, unequal = math.unequal +const assert = require('assert'), math = require('../../../src/main'), bignumber = math.bignumber, complex = math.complex, matrix = math.matrix, sparse = math.sparse, unit = math.unit, unequal = math.unequal describe('unequal', function () { it('should compare two numbers correctly', function () { diff --git a/test/function/set/setCartesian.test.js b/test/function/set/setCartesian.test.js index 665d1db41..85b910a7d 100644 --- a/test/function/set/setCartesian.test.js +++ b/test/function/set/setCartesian.test.js @@ -1,6 +1,6 @@ // test setCartesian const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') describe('setCartesian', function () { it('should return the cartesian product of two sets', function () { diff --git a/test/function/set/setDifference.test.js b/test/function/set/setDifference.test.js index 762f88c4f..e3abed6bb 100644 --- a/test/function/set/setDifference.test.js +++ b/test/function/set/setDifference.test.js @@ -1,6 +1,6 @@ // test setDifference const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') describe('setDifference', function () { it('should return the difference of two sets', function () { diff --git a/test/function/set/setDistinct.test.js b/test/function/set/setDistinct.test.js index 75fff3858..dbe7fc4c5 100644 --- a/test/function/set/setDistinct.test.js +++ b/test/function/set/setDistinct.test.js @@ -1,6 +1,6 @@ // test setDistinct const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') describe('setDistinct', function () { it('should return the elements of a set', function () { diff --git a/test/function/set/setIntersect.test.js b/test/function/set/setIntersect.test.js index d2ff0de17..5aaf5a50b 100644 --- a/test/function/set/setIntersect.test.js +++ b/test/function/set/setIntersect.test.js @@ -1,6 +1,6 @@ // test setIntersect const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') describe('setIntersect', function () { it('should return the intersection of two sets', function () { diff --git a/test/function/set/setIsSubset.test.js b/test/function/set/setIsSubset.test.js index 5d0a9daa5..e97c929f6 100644 --- a/test/function/set/setIsSubset.test.js +++ b/test/function/set/setIsSubset.test.js @@ -1,6 +1,6 @@ // test setIsSubset const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') describe('setIsSubset', function () { it('should return true or false', function () { diff --git a/test/function/set/setMultiplicity.test.js b/test/function/set/setMultiplicity.test.js index ab0b99796..88d75778e 100644 --- a/test/function/set/setMultiplicity.test.js +++ b/test/function/set/setMultiplicity.test.js @@ -1,6 +1,6 @@ // test setMultiplicity const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') describe('setMultiplicity', function () { it('should return the multiplicity on an element of a set', function () { diff --git a/test/function/set/setPowerset.test.js b/test/function/set/setPowerset.test.js index e404573e3..292ad9da4 100644 --- a/test/function/set/setPowerset.test.js +++ b/test/function/set/setPowerset.test.js @@ -1,6 +1,6 @@ // test setPowerset const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') describe('setPowerset', function () { it('should return the powerset of a set', function () { diff --git a/test/function/set/setSize.test.js b/test/function/set/setSize.test.js index ea5cd5970..310ee4e41 100644 --- a/test/function/set/setSize.test.js +++ b/test/function/set/setSize.test.js @@ -1,6 +1,6 @@ // test setSize const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') describe('setSize', function () { it('should return the number of elements of a set', function () { diff --git a/test/function/set/setSymDifference.test.js b/test/function/set/setSymDifference.test.js index 2cfb76474..b43326bd9 100644 --- a/test/function/set/setSymDifference.test.js +++ b/test/function/set/setSymDifference.test.js @@ -1,6 +1,6 @@ // test setSymDifference const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') describe('setSymDifference', function () { it('should return the symetric difference of two sets', function () { diff --git a/test/function/set/setUnion.test.js b/test/function/set/setUnion.test.js index f45841201..414c47e69 100644 --- a/test/function/set/setUnion.test.js +++ b/test/function/set/setUnion.test.js @@ -1,6 +1,6 @@ // test setUnion const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') describe('setUnion', function () { it('should return the union of two sets', function () { diff --git a/test/function/special/erf.test.js b/test/function/special/erf.test.js index 06476225c..909a6ea3f 100644 --- a/test/function/special/erf.test.js +++ b/test/function/special/erf.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), approx = require('../../../tools/approx'), error = require('../../../src/error/index'), math = require('../../../src/index'), bigUtil = require('../../../src/utils/index').bignumber, bignumber = math.bignumber, subtract = math.subtract, abs = math.abs, smaller = math.smaller, erf = math.erf, actualErfValues = require('./erf.values.json') +const assert = require('assert'), approx = require('../../../tools/approx'), error = require('../../../src/error/index'), math = require('../../../src/main'), bigUtil = require('../../../src/utils/index').bignumber, bignumber = math.bignumber, subtract = math.subtract, abs = math.abs, smaller = math.smaller, erf = math.erf, actualErfValues = require('./erf.values.json') const DIFF_THRESH = 5e-16 diff --git a/test/function/statistics/mad.test.js b/test/function/statistics/mad.test.js index fa439cd72..f05cb7915 100644 --- a/test/function/statistics/mad.test.js +++ b/test/function/statistics/mad.test.js @@ -1,6 +1,6 @@ const assert = require('assert') const approx = require('../../../tools/approx') -const math = require('../../../src/index') +const math = require('../../../src/main') const BigNumber = math.type.BigNumber const DenseMatrix = math.type.DenseMatrix const Complex = math.type.Complex diff --git a/test/function/statistics/max.test.js b/test/function/statistics/max.test.js index d102de633..517caaf04 100644 --- a/test/function/statistics/max.test.js +++ b/test/function/statistics/max.test.js @@ -1,5 +1,5 @@ const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') const BigNumber = math.type.BigNumber const Complex = math.type.Complex const DenseMatrix = math.type.DenseMatrix diff --git a/test/function/statistics/mean.test.js b/test/function/statistics/mean.test.js index f098031af..ad76591f2 100644 --- a/test/function/statistics/mean.test.js +++ b/test/function/statistics/mean.test.js @@ -1,5 +1,5 @@ const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') const BigNumber = math.type.BigNumber const Complex = math.type.Complex const DenseMatrix = math.type.DenseMatrix diff --git a/test/function/statistics/median.test.js b/test/function/statistics/median.test.js index 690ec9ccd..fd8000cf4 100644 --- a/test/function/statistics/median.test.js +++ b/test/function/statistics/median.test.js @@ -1,6 +1,6 @@ const assert = require('assert') const approx = require('../../../tools/approx') -const math = require('../../../src/index') +const math = require('../../../src/main') const BigNumber = math.type.BigNumber const Complex = math.type.Complex const DenseMatrix = math.type.DenseMatrix diff --git a/test/function/statistics/min.test.js b/test/function/statistics/min.test.js index 2c7275c02..43d454aad 100644 --- a/test/function/statistics/min.test.js +++ b/test/function/statistics/min.test.js @@ -1,5 +1,5 @@ const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') const BigNumber = math.type.BigNumber const Complex = math.type.Complex const DenseMatrix = math.type.DenseMatrix diff --git a/test/function/statistics/mode.test.js b/test/function/statistics/mode.test.js index 5b56d3b11..824b3c457 100644 --- a/test/function/statistics/mode.test.js +++ b/test/function/statistics/mode.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), math = require('../../../src/index'), mode = math.mode, DenseMatrix = math.type.DenseMatrix +const assert = require('assert'), math = require('../../../src/main'), mode = math.mode, DenseMatrix = math.type.DenseMatrix describe('mode', function () { it('should return the mode accurately for one dimensional array', function () { diff --git a/test/function/statistics/prod.test.js b/test/function/statistics/prod.test.js index 62ae4a35a..6e49fd4c4 100644 --- a/test/function/statistics/prod.test.js +++ b/test/function/statistics/prod.test.js @@ -1,5 +1,5 @@ const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') const BigNumber = math.type.BigNumber const Complex = math.type.Complex const DenseMatrix = math.type.DenseMatrix diff --git a/test/function/statistics/quantileSeq.test.js b/test/function/statistics/quantileSeq.test.js index 89d6fd32f..03adbab6d 100644 --- a/test/function/statistics/quantileSeq.test.js +++ b/test/function/statistics/quantileSeq.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), approx = require('../../../tools/approx'), math = require('../../../src/index'), bignumber = math.bignumber, quantileSeq = math.quantileSeq +const assert = require('assert'), approx = require('../../../tools/approx'), math = require('../../../src/main'), bignumber = math.bignumber, quantileSeq = math.quantileSeq describe('quantileSeq', function () { it('should return the quantileSeq from an array with number probability', function () { diff --git a/test/function/statistics/std.test.js b/test/function/statistics/std.test.js index a498be4c9..e86e52d25 100644 --- a/test/function/statistics/std.test.js +++ b/test/function/statistics/std.test.js @@ -1,6 +1,6 @@ const assert = require('assert') const approx = require('../../../tools/approx') -const math = require('../../../src/index') +const math = require('../../../src/main') const BigNumber = math.type.BigNumber const Complex = math.type.Complex const DenseMatrix = math.type.DenseMatrix diff --git a/test/function/statistics/sum.test.js b/test/function/statistics/sum.test.js index fdc75f1aa..c5ea1d17a 100644 --- a/test/function/statistics/sum.test.js +++ b/test/function/statistics/sum.test.js @@ -1,5 +1,5 @@ const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') const BigNumber = math.type.BigNumber const Complex = math.type.Complex const DenseMatrix = math.type.DenseMatrix diff --git a/test/function/statistics/var.test.js b/test/function/statistics/var.test.js index 4552674aa..4032db7ef 100644 --- a/test/function/statistics/var.test.js +++ b/test/function/statistics/var.test.js @@ -1,5 +1,5 @@ const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') const BigNumber = math.type.BigNumber const Complex = math.type.Complex const DenseMatrix = math.type.DenseMatrix diff --git a/test/function/string/format.test.js b/test/function/string/format.test.js index 2ce0b5fb3..3a14bc05b 100644 --- a/test/function/string/format.test.js +++ b/test/function/string/format.test.js @@ -1,5 +1,5 @@ // test format -const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/index') +const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/main') describe('format', function () { it('should format numbers', function () { diff --git a/test/function/string/print.test.js b/test/function/string/print.test.js index f9d6d3b47..ef6d2adda 100644 --- a/test/function/string/print.test.js +++ b/test/function/string/print.test.js @@ -1,5 +1,5 @@ // test print -const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/index') +const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/main') describe('print', function () { it('should interpolate values in a template (object template)', function () { diff --git a/test/function/trigonometry/acos.test.js b/test/function/trigonometry/acos.test.js index b9d7292ab..dde83638c 100644 --- a/test/function/trigonometry/acos.test.js +++ b/test/function/trigonometry/acos.test.js @@ -1,5 +1,5 @@ const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') const approx = require('../../../tools/approx') const pi = math.pi const acos = math.acos diff --git a/test/function/trigonometry/acosh.test.js b/test/function/trigonometry/acosh.test.js index 1a3c872d5..1eefdbb78 100644 --- a/test/function/trigonometry/acosh.test.js +++ b/test/function/trigonometry/acosh.test.js @@ -1,6 +1,6 @@ const assert = require('assert') const error = require('../../../src/error/index') -const math = require('../../../src/index') +const math = require('../../../src/main') const approx = require('../../../tools/approx') const pi = math.pi const acosh = math.acosh diff --git a/test/function/trigonometry/acot.test.js b/test/function/trigonometry/acot.test.js index 484beaf6c..ecf9ea59d 100644 --- a/test/function/trigonometry/acot.test.js +++ b/test/function/trigonometry/acot.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/index'), approx = require('../../../tools/approx'), pi = math.pi, complex = math.complex, matrix = math.matrix, unit = math.unit, acot = math.acot, cot = math.cot, bigmath = math.create({number: 'BigNumber', precision: 20}), acotBig = bigmath.acot, cotBig = bigmath.cot, Big = bigmath.bignumber +const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/main'), approx = require('../../../tools/approx'), pi = math.pi, complex = math.complex, matrix = math.matrix, unit = math.unit, acot = math.acot, cot = math.cot, bigmath = math.create({number: 'BigNumber', precision: 20}), acotBig = bigmath.acot, cotBig = bigmath.cot, Big = bigmath.bignumber describe('acot', function () { it('should return the arccot of a boolean', function () { diff --git a/test/function/trigonometry/acoth.test.js b/test/function/trigonometry/acoth.test.js index 2d1d88379..bc6e5d057 100644 --- a/test/function/trigonometry/acoth.test.js +++ b/test/function/trigonometry/acoth.test.js @@ -1,6 +1,6 @@ const assert = require('assert') const error = require('../../../src/error/index') -const math = require('../../../src/index') +const math = require('../../../src/main') const approx = require('../../../tools/approx') const pi = math.pi const acoth = math.acoth diff --git a/test/function/trigonometry/acsc.test.js b/test/function/trigonometry/acsc.test.js index 340193218..f04f9b826 100644 --- a/test/function/trigonometry/acsc.test.js +++ b/test/function/trigonometry/acsc.test.js @@ -1,6 +1,6 @@ const assert = require('assert') const error = require('../../../src/error/index') -const math = require('../../../src/index') +const math = require('../../../src/main') const approx = require('../../../tools/approx') const pi = math.pi const complex = math.complex diff --git a/test/function/trigonometry/acsch.test.js b/test/function/trigonometry/acsch.test.js index bd00c231d..525a3f615 100644 --- a/test/function/trigonometry/acsch.test.js +++ b/test/function/trigonometry/acsch.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/index'), approx = require('../../../tools/approx'), pi = math.pi, acsch = math.acsch, csch = math.csch, complex = math.complex, matrix = math.matrix, unit = math.unit, bigmath = math.create({number: 'BigNumber', precision: 20}), acschBig = bigmath.acsch, Big = bigmath.bignumber +const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/main'), approx = require('../../../tools/approx'), pi = math.pi, acsch = math.acsch, csch = math.csch, complex = math.complex, matrix = math.matrix, unit = math.unit, bigmath = math.create({number: 'BigNumber', precision: 20}), acschBig = bigmath.acsch, Big = bigmath.bignumber describe('acsch', function () { it('should return the hyperbolic arccsc of a boolean', function () { diff --git a/test/function/trigonometry/asec.test.js b/test/function/trigonometry/asec.test.js index b513c60e9..e24bf205c 100644 --- a/test/function/trigonometry/asec.test.js +++ b/test/function/trigonometry/asec.test.js @@ -1,6 +1,6 @@ const assert = require('assert') const error = require('../../../src/error/index') -const math = require('../../../src/index') +const math = require('../../../src/main') const approx = require('../../../tools/approx') const pi = math.pi const asec = math.asec diff --git a/test/function/trigonometry/asech.test.js b/test/function/trigonometry/asech.test.js index 047ff697f..45e4e4686 100644 --- a/test/function/trigonometry/asech.test.js +++ b/test/function/trigonometry/asech.test.js @@ -1,6 +1,6 @@ const assert = require('assert') const error = require('../../../src/error/index') -const math = require('../../../src/index') +const math = require('../../../src/main') const approx = require('../../../tools/approx') const pi = math.pi const asech = math.asech diff --git a/test/function/trigonometry/asin.test.js b/test/function/trigonometry/asin.test.js index 7a0347fcb..69278ad16 100644 --- a/test/function/trigonometry/asin.test.js +++ b/test/function/trigonometry/asin.test.js @@ -1,6 +1,6 @@ const assert = require('assert') const error = require('../../../src/error/index') -const math = require('../../../src/index') +const math = require('../../../src/main') const approx = require('../../../tools/approx') const pi = math.pi const complex = math.complex diff --git a/test/function/trigonometry/asinh.test.js b/test/function/trigonometry/asinh.test.js index d2dc3ec5f..22fb40c14 100644 --- a/test/function/trigonometry/asinh.test.js +++ b/test/function/trigonometry/asinh.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/index'), approx = require('../../../tools/approx'), pi = math.pi, asinh = math.asinh, sinh = math.sinh, complex = math.complex, matrix = math.matrix, unit = math.unit, bigmath = math.create({number: 'BigNumber', precision: 20}), biggermath = math.create({precision: 21}), asinhBig = bigmath.asinh, Big = bigmath.bignumber +const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/main'), approx = require('../../../tools/approx'), pi = math.pi, asinh = math.asinh, sinh = math.sinh, complex = math.complex, matrix = math.matrix, unit = math.unit, bigmath = math.create({number: 'BigNumber', precision: 20}), biggermath = math.create({precision: 21}), asinhBig = bigmath.asinh, Big = bigmath.bignumber describe('asinh', function () { it('should return the hyperbolic arcsin of a boolean', function () { diff --git a/test/function/trigonometry/atan.test.js b/test/function/trigonometry/atan.test.js index fc8bd998d..2322d3e34 100644 --- a/test/function/trigonometry/atan.test.js +++ b/test/function/trigonometry/atan.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/index'), approx = require('../../../tools/approx'), pi = math.pi, complex = math.complex, matrix = math.matrix, unit = math.unit, atan = math.atan, tan = math.tan, bigmath = math.create({number: 'BigNumber', precision: 20}), atanBig = bigmath.atan, Big = bigmath.bignumber +const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/main'), approx = require('../../../tools/approx'), pi = math.pi, complex = math.complex, matrix = math.matrix, unit = math.unit, atan = math.atan, tan = math.tan, bigmath = math.create({number: 'BigNumber', precision: 20}), atanBig = bigmath.atan, Big = bigmath.bignumber describe('atan', function () { it('should return the arctan of a boolean', function () { diff --git a/test/function/trigonometry/atan2.test.js b/test/function/trigonometry/atan2.test.js index 708b1ef3c..3c0cafbd8 100644 --- a/test/function/trigonometry/atan2.test.js +++ b/test/function/trigonometry/atan2.test.js @@ -1,5 +1,5 @@ // test atan2 -const assert = require('assert'), math = require('../../../src/index'), approx = require('../../../tools/approx'), pi = math.pi, complex = math.complex, matrix = math.matrix, sparse = math.sparse, unit = math.unit, divide = math.divide, atan2 = math.atan2, bigmath = math.create({precision: 20}), Big = bigmath.bignumber, atan2Big = bigmath.atan2 +const assert = require('assert'), math = require('../../../src/main'), approx = require('../../../tools/approx'), pi = math.pi, complex = math.complex, matrix = math.matrix, sparse = math.sparse, unit = math.unit, divide = math.divide, atan2 = math.atan2, bigmath = math.create({precision: 20}), Big = bigmath.bignumber, atan2Big = bigmath.atan2 describe('atan2', function () { it('should calculate atan2 correctly', function () { diff --git a/test/function/trigonometry/atanh.test.js b/test/function/trigonometry/atanh.test.js index e2f659cbe..e734451cf 100644 --- a/test/function/trigonometry/atanh.test.js +++ b/test/function/trigonometry/atanh.test.js @@ -1,6 +1,6 @@ const assert = require('assert') const error = require('../../../src/error/index') -const math = require('../../../src/index') +const math = require('../../../src/main') const approx = require('../../../tools/approx') const pi = math.pi const atanh = math.atanh diff --git a/test/function/trigonometry/cos.test.js b/test/function/trigonometry/cos.test.js index d3f9081b6..dc9d3742b 100644 --- a/test/function/trigonometry/cos.test.js +++ b/test/function/trigonometry/cos.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/index'), approx = require('../../../tools/approx'), pi = math.pi, complex = math.complex, matrix = math.matrix, unit = math.unit, cos = math.cos, bigmath = math.create({number: 'BigNumber', precision: 15}), biggermath = math.create({number: 'BigNumber', precision: 238}) +const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/main'), approx = require('../../../tools/approx'), pi = math.pi, complex = math.complex, matrix = math.matrix, unit = math.unit, cos = math.cos, bigmath = math.create({number: 'BigNumber', precision: 15}), biggermath = math.create({number: 'BigNumber', precision: 238}) describe('cos', function () { it('should return the cosine of a boolean', function () { diff --git a/test/function/trigonometry/cosh.test.js b/test/function/trigonometry/cosh.test.js index 3213eb93b..9840390a8 100644 --- a/test/function/trigonometry/cosh.test.js +++ b/test/function/trigonometry/cosh.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/index'), approx = require('../../../tools/approx'), pi = math.pi, complex = math.complex, matrix = math.matrix, unit = math.unit, cosh = math.cosh, bigmath = math.create({number: 'BigNumber', precision: 20}) +const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/main'), approx = require('../../../tools/approx'), pi = math.pi, complex = math.complex, matrix = math.matrix, unit = math.unit, cosh = math.cosh, bigmath = math.create({number: 'BigNumber', precision: 20}) describe('cosh', function () { it('should return the cosh of a boolean', function () { diff --git a/test/function/trigonometry/cot.test.js b/test/function/trigonometry/cot.test.js index 77d75d563..e5d771722 100644 --- a/test/function/trigonometry/cot.test.js +++ b/test/function/trigonometry/cot.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/index'), approx = require('../../../tools/approx'), pi = math.pi, complex = math.complex, matrix = math.matrix, unit = math.unit, cot = math.cot, bigmath = math.create({number: 'BigNumber', precision: 20}), biggermath = math.create({number: 'BigNumber', precision: 22}) +const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/main'), approx = require('../../../tools/approx'), pi = math.pi, complex = math.complex, matrix = math.matrix, unit = math.unit, cot = math.cot, bigmath = math.create({number: 'BigNumber', precision: 20}), biggermath = math.create({number: 'BigNumber', precision: 22}) describe('cot', function () { it('should return the cotan of a boolean', function () { diff --git a/test/function/trigonometry/coth.test.js b/test/function/trigonometry/coth.test.js index fdb638522..e748ed4cd 100644 --- a/test/function/trigonometry/coth.test.js +++ b/test/function/trigonometry/coth.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/index'), approx = require('../../../tools/approx'), pi = math.pi, complex = math.complex, matrix = math.matrix, unit = math.unit, coth = math.coth, bigmath = math.create({precision: 20}), biggermath = math.create({number: 'BigNumber', precision: 21}) +const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/main'), approx = require('../../../tools/approx'), pi = math.pi, complex = math.complex, matrix = math.matrix, unit = math.unit, coth = math.coth, bigmath = math.create({precision: 20}), biggermath = math.create({number: 'BigNumber', precision: 21}) describe('coth', function () { it('should return the coth of a boolean', function () { diff --git a/test/function/trigonometry/csc.test.js b/test/function/trigonometry/csc.test.js index 0c812d13c..662c866a2 100644 --- a/test/function/trigonometry/csc.test.js +++ b/test/function/trigonometry/csc.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/index'), approx = require('../../../tools/approx'), pi = math.pi, complex = math.complex, matrix = math.matrix, unit = math.unit, csc = math.csc, bigmath = math.create({number: 'BigNumber', precision: 20}), biggermath = math.create({number: 'BigNumber', precision: 21}) +const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/main'), approx = require('../../../tools/approx'), pi = math.pi, complex = math.complex, matrix = math.matrix, unit = math.unit, csc = math.csc, bigmath = math.create({number: 'BigNumber', precision: 20}), biggermath = math.create({number: 'BigNumber', precision: 21}) describe('csc', function () { it('should return the cosecant of a boolean', function () { diff --git a/test/function/trigonometry/csch.test.js b/test/function/trigonometry/csch.test.js index e6a516e8a..8ac29225f 100644 --- a/test/function/trigonometry/csch.test.js +++ b/test/function/trigonometry/csch.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/index'), approx = require('../../../tools/approx'), pi = math.pi, complex = math.complex, matrix = math.matrix, unit = math.unit, csch = math.csch, bigmath = math.create({precision: 20}), biggermath = math.create({number: 'BigNumber', precision: 22}) +const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/main'), approx = require('../../../tools/approx'), pi = math.pi, complex = math.complex, matrix = math.matrix, unit = math.unit, csch = math.csch, bigmath = math.create({precision: 20}), biggermath = math.create({number: 'BigNumber', precision: 22}) describe('csch', function () { it('should return the csch of a boolean', function () { diff --git a/test/function/trigonometry/sec.test.js b/test/function/trigonometry/sec.test.js index be0b37056..ac4ec171f 100644 --- a/test/function/trigonometry/sec.test.js +++ b/test/function/trigonometry/sec.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/index'), approx = require('../../../tools/approx'), pi = math.pi, complex = math.complex, matrix = math.matrix, unit = math.unit, sec = math.sec, bigmath = math.create({number: 'BigNumber', precision: 20}), biggermath = math.create({number: 'BigNumber', precision: 21}) +const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/main'), approx = require('../../../tools/approx'), pi = math.pi, complex = math.complex, matrix = math.matrix, unit = math.unit, sec = math.sec, bigmath = math.create({number: 'BigNumber', precision: 20}), biggermath = math.create({number: 'BigNumber', precision: 21}) describe('sec', function () { it('should return the secant of a boolean', function () { diff --git a/test/function/trigonometry/sech.test.js b/test/function/trigonometry/sech.test.js index 5f2611aaf..8481de7ae 100644 --- a/test/function/trigonometry/sech.test.js +++ b/test/function/trigonometry/sech.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/index'), approx = require('../../../tools/approx'), pi = math.pi, complex = math.complex, matrix = math.matrix, unit = math.unit, sech = math.sech, bigmath = math.create({precision: 20}), biggermath = math.create({number: 'BigNumber', precision: 21}) +const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/main'), approx = require('../../../tools/approx'), pi = math.pi, complex = math.complex, matrix = math.matrix, unit = math.unit, sech = math.sech, bigmath = math.create({precision: 20}), biggermath = math.create({number: 'BigNumber', precision: 21}) describe('sech', function () { it('should return the sech of a boolean', function () { diff --git a/test/function/trigonometry/sin.test.js b/test/function/trigonometry/sin.test.js index f9c8bbb3b..75500c5a7 100644 --- a/test/function/trigonometry/sin.test.js +++ b/test/function/trigonometry/sin.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/index'), approx = require('../../../tools/approx'), pi = math.pi, complex = math.complex, matrix = math.matrix, unit = math.unit, sin = math.sin, bigmath = math.create({precision: 242}) +const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/main'), approx = require('../../../tools/approx'), pi = math.pi, complex = math.complex, matrix = math.matrix, unit = math.unit, sin = math.sin, bigmath = math.create({precision: 242}) describe('sin', function () { it('should return the sine of a boolean', function () { diff --git a/test/function/trigonometry/sinh.test.js b/test/function/trigonometry/sinh.test.js index bdc4861ec..f88db49c8 100644 --- a/test/function/trigonometry/sinh.test.js +++ b/test/function/trigonometry/sinh.test.js @@ -1,6 +1,6 @@ const assert = require('assert') const error = require('../../../src/error/index') -const math = require('../../../src/index') +const math = require('../../../src/main') const approx = require('../../../tools/approx') const complex = math.complex const matrix = math.matrix diff --git a/test/function/trigonometry/tan.test.js b/test/function/trigonometry/tan.test.js index 869eadd2e..410ea2cfe 100644 --- a/test/function/trigonometry/tan.test.js +++ b/test/function/trigonometry/tan.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/index'), approx = require('../../../tools/approx'), pi = math.pi, complex = math.complex, matrix = math.matrix, unit = math.unit, tan = math.tan, piBigmath = math.create({number: 'BigNumber', precision: 21}), bigmath = math.create({precision: 20}), Big = bigmath.bignumber, bigTan = bigmath.tan +const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/main'), approx = require('../../../tools/approx'), pi = math.pi, complex = math.complex, matrix = math.matrix, unit = math.unit, tan = math.tan, piBigmath = math.create({number: 'BigNumber', precision: 21}), bigmath = math.create({precision: 20}), Big = bigmath.bignumber, bigTan = bigmath.tan describe('tan', function () { it('should return the tangent of a boolean', function () { diff --git a/test/function/trigonometry/tanh.test.js b/test/function/trigonometry/tanh.test.js index 41b050bd1..ef8775e35 100644 --- a/test/function/trigonometry/tanh.test.js +++ b/test/function/trigonometry/tanh.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/index'), approx = require('../../../tools/approx'), pi = math.pi, complex = math.complex, matrix = math.matrix, unit = math.unit, tanh = math.tanh, bigmath = math.create({number: 'BigNumber', precision: 20}) +const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/main'), approx = require('../../../tools/approx'), pi = math.pi, complex = math.complex, matrix = math.matrix, unit = math.unit, tanh = math.tanh, bigmath = math.create({number: 'BigNumber', precision: 20}) describe('tanh', function () { it('should return the tanh of a boolean', function () { diff --git a/test/function/unit/to.test.js b/test/function/unit/to.test.js index 5dce76d65..8cf660ae0 100644 --- a/test/function/unit/to.test.js +++ b/test/function/unit/to.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), approx = require('../../../tools/approx'), math = require('../../../src/index'), matrix = math.matrix, sparse = math.sparse, Unit = math.type.Unit, unit = math.unit +const assert = require('assert'), approx = require('../../../tools/approx'), math = require('../../../src/main'), matrix = math.matrix, sparse = math.sparse, Unit = math.type.Unit, unit = math.unit describe('to', function () { it('should perform the given unit conversion', function () { diff --git a/test/function/utils/clone.test.js b/test/function/utils/clone.test.js index f478abe13..7343ebd36 100644 --- a/test/function/utils/clone.test.js +++ b/test/function/utils/clone.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/index') +const assert = require('assert'), error = require('../../../src/error/index'), math = require('../../../src/main') describe('clone', function () { it('should clone a boolean', function () { diff --git a/test/function/utils/isInteger.test.js b/test/function/utils/isInteger.test.js index cde5c7d3c..95831fc88 100644 --- a/test/function/utils/isInteger.test.js +++ b/test/function/utils/isInteger.test.js @@ -1,5 +1,5 @@ const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') const isInteger = math.isInteger const bignumber = math.bignumber const fraction = math.fraction diff --git a/test/function/utils/isNaN.test.js b/test/function/utils/isNaN.test.js index bcecccec1..29af034f8 100644 --- a/test/function/utils/isNaN.test.js +++ b/test/function/utils/isNaN.test.js @@ -1,5 +1,5 @@ const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') const isNaN = math.isNaN const bignumber = math.bignumber const fraction = math.fraction diff --git a/test/function/utils/isNegative.test.js b/test/function/utils/isNegative.test.js index 50b8cb661..825235628 100644 --- a/test/function/utils/isNegative.test.js +++ b/test/function/utils/isNegative.test.js @@ -1,5 +1,5 @@ const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') const isNegative = math.isNegative const bignumber = math.bignumber const fraction = math.fraction diff --git a/test/function/utils/isNumeric.test.js b/test/function/utils/isNumeric.test.js index 35cb66f5a..a9aec6f07 100644 --- a/test/function/utils/isNumeric.test.js +++ b/test/function/utils/isNumeric.test.js @@ -1,5 +1,5 @@ const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') const isNumeric = math.isNumeric const bignumber = math.bignumber const fraction = math.fraction diff --git a/test/function/utils/isPositive.test.js b/test/function/utils/isPositive.test.js index 9e3d2b3f0..3d1df3674 100644 --- a/test/function/utils/isPositive.test.js +++ b/test/function/utils/isPositive.test.js @@ -1,5 +1,5 @@ const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') const isPositive = math.isPositive const bignumber = math.bignumber const fraction = math.fraction diff --git a/test/function/utils/isPrime.test.js b/test/function/utils/isPrime.test.js index d411af3c5..2341d8de5 100644 --- a/test/function/utils/isPrime.test.js +++ b/test/function/utils/isPrime.test.js @@ -1,5 +1,5 @@ const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') const isPrime = math.isPrime const bignumber = math.bignumber const complex = math.complex diff --git a/test/function/utils/isZero.test.js b/test/function/utils/isZero.test.js index c7fd41960..f6159df12 100644 --- a/test/function/utils/isZero.test.js +++ b/test/function/utils/isZero.test.js @@ -1,5 +1,5 @@ const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') const isZero = math.isZero const bignumber = math.bignumber const fraction = math.fraction diff --git a/test/function/utils/typeof.test.js b/test/function/utils/typeof.test.js index 13b62d4fd..b3416fd2f 100644 --- a/test/function/utils/typeof.test.js +++ b/test/function/utils/typeof.test.js @@ -1,6 +1,6 @@ // test typeof const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') const Index = math.type.Index const Range = math.type.Range const Matrix = math.type.Matrix diff --git a/test/index.test.js b/test/index.test.js index 1436723d1..b9c37e916 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -1,5 +1,5 @@ const assert = require('assert') -const math = require('../src/index') +const math = require('../src/main') describe('factory', function () { it('should get a default instance of mathjs', function () { diff --git a/test/json/replacer.test.js b/test/json/replacer.test.js index a9f578cba..c17404134 100644 --- a/test/json/replacer.test.js +++ b/test/json/replacer.test.js @@ -1,5 +1,5 @@ const assert = require('assert') -const math = require('../../src/index') +const math = require('../../src/main') describe('replacer', function () { it('should stringify generic JSON', function () { diff --git a/test/json/reviver.test.js b/test/json/reviver.test.js index 65ed78ec3..79c670c70 100644 --- a/test/json/reviver.test.js +++ b/test/json/reviver.test.js @@ -1,5 +1,5 @@ const assert = require('assert') -const math = require('../../src/index') +const math = require('../../src/main') const reviver = math.json.reviver const Range = math.type.Range diff --git a/test/type/bignumber/BigNumber.test.js b/test/type/bignumber/BigNumber.test.js index f93e0382f..85d7e43e4 100644 --- a/test/type/bignumber/BigNumber.test.js +++ b/test/type/bignumber/BigNumber.test.js @@ -1,5 +1,5 @@ const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') describe('BigNumber', function () { it('should have a property isBigNumber', function () { diff --git a/test/type/bignumber/function/bignumber.test.js b/test/type/bignumber/function/bignumber.test.js index 9233f8978..fa8fa8d72 100644 --- a/test/type/bignumber/function/bignumber.test.js +++ b/test/type/bignumber/function/bignumber.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), error = require('../../../../src/error/index'), math = require('../../../../src/index'), bignumber = math.bignumber, BigNumber = math.type.BigNumber +const assert = require('assert'), error = require('../../../../src/error/index'), math = require('../../../../src/main'), bignumber = math.bignumber, BigNumber = math.type.BigNumber describe('bignumber', function () { it('should create a bignumber', function () { diff --git a/test/type/boolean.test.js b/test/type/boolean.test.js index 063d3dc48..1f7d14d54 100644 --- a/test/type/boolean.test.js +++ b/test/type/boolean.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), error = require('../../src/error/index'), math = require('../../src/index'), bool = math['boolean'] +const assert = require('assert'), error = require('../../src/error/index'), math = require('../../src/main'), bool = math['boolean'] describe('boolean', function () { it('should convert a boolean to a boolean', function () { diff --git a/test/type/chain/Chain.test.js b/test/type/chain/Chain.test.js index ea9430c9f..23d5b9770 100644 --- a/test/type/chain/Chain.test.js +++ b/test/type/chain/Chain.test.js @@ -1,7 +1,7 @@ // test chain const assert = require('assert') const approx = require('../../../tools/approx') -const math = require('../../../src/index') +const math = require('../../../src/main') const Chain = math.type.Chain describe('Chain', function () { diff --git a/test/type/chain/function/chain.test.js b/test/type/chain/function/chain.test.js index 50b5fd881..532c9125c 100644 --- a/test/type/chain/function/chain.test.js +++ b/test/type/chain/function/chain.test.js @@ -1,5 +1,5 @@ const assert = require('assert') -const math = require('../../../../src/index') +const math = require('../../../../src/main') const Chain = math.type.Chain describe('chain', function () { diff --git a/test/type/complex/Complex.test.js b/test/type/complex/Complex.test.js index 3df1288d1..9885e3529 100644 --- a/test/type/complex/Complex.test.js +++ b/test/type/complex/Complex.test.js @@ -1,7 +1,7 @@ // test data type Complex const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') const Unit = math.type.Unit const Complex = math.type.Complex diff --git a/test/type/complex/function/complex.test.js b/test/type/complex/function/complex.test.js index 041bed8dd..ba7258ea8 100644 --- a/test/type/complex/function/complex.test.js +++ b/test/type/complex/function/complex.test.js @@ -1,6 +1,6 @@ const assert = require('assert') const error = require('../../../../src/error/index') -const math = require('../../../../src/index') +const math = require('../../../../src/main') const complex = math.complex describe('complex', function () { diff --git a/test/type/fraction/Fraction.test.js b/test/type/fraction/Fraction.test.js index c0e6bc600..28c452122 100644 --- a/test/type/fraction/Fraction.test.js +++ b/test/type/fraction/Fraction.test.js @@ -1,5 +1,5 @@ const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') describe('Fraction', function () { it('should have a property isFraction', function () { diff --git a/test/type/fraction/function/fraction.test.js b/test/type/fraction/function/fraction.test.js index 9154d1700..758b776fc 100644 --- a/test/type/fraction/function/fraction.test.js +++ b/test/type/fraction/function/fraction.test.js @@ -1,5 +1,5 @@ const assert = require('assert') -const math = require('../../../../src/index') +const math = require('../../../../src/main') const Fraction = require('fraction.js') describe('fraction', function () { diff --git a/test/type/matrix/DenseMatrix.test.js b/test/type/matrix/DenseMatrix.test.js index b6490b668..cef21ce99 100644 --- a/test/type/matrix/DenseMatrix.test.js +++ b/test/type/matrix/DenseMatrix.test.js @@ -1,5 +1,5 @@ const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') const Matrix = math.type.Matrix const DenseMatrix = math.type.DenseMatrix const SparseMatrix = math.type.SparseMatrix diff --git a/test/type/matrix/FibonacciHeap.test.js b/test/type/matrix/FibonacciHeap.test.js index 70545ee63..3f12d6253 100644 --- a/test/type/matrix/FibonacciHeap.test.js +++ b/test/type/matrix/FibonacciHeap.test.js @@ -1,5 +1,5 @@ const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') const FibonacciHeap = math.type.FibonacciHeap describe('FibonacciHeap', function () { diff --git a/test/type/matrix/ImmutableDenseMatrix.test.js b/test/type/matrix/ImmutableDenseMatrix.test.js index aefd8455a..8ce13e919 100644 --- a/test/type/matrix/ImmutableDenseMatrix.test.js +++ b/test/type/matrix/ImmutableDenseMatrix.test.js @@ -1,5 +1,5 @@ const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') const Matrix = math.type.Matrix const DenseMatrix = math.type.DenseMatrix const ImmutableDenseMatrix = math.type.ImmutableDenseMatrix diff --git a/test/type/matrix/Index.test.js b/test/type/matrix/Index.test.js index dc099de42..a00a34d64 100644 --- a/test/type/matrix/Index.test.js +++ b/test/type/matrix/Index.test.js @@ -1,6 +1,6 @@ // test data type Index const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') const Index = math.type.Index const Range = math.type.Range const ImmutableDenseMatrix = math.type.ImmutableDenseMatrix diff --git a/test/type/matrix/Matrix.test.js b/test/type/matrix/Matrix.test.js index bfa961038..46866fdf8 100644 --- a/test/type/matrix/Matrix.test.js +++ b/test/type/matrix/Matrix.test.js @@ -1,5 +1,5 @@ const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') const Matrix = math.type.Matrix describe('matrix', function () { diff --git a/test/type/matrix/Range.test.js b/test/type/matrix/Range.test.js index e45a691bd..e32e16262 100644 --- a/test/type/matrix/Range.test.js +++ b/test/type/matrix/Range.test.js @@ -1,7 +1,7 @@ // test data type Range const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') const Range = math.type.Range describe('range', function () { diff --git a/test/type/matrix/Spa.test.js b/test/type/matrix/Spa.test.js index 8e6928943..ce27c8f1e 100644 --- a/test/type/matrix/Spa.test.js +++ b/test/type/matrix/Spa.test.js @@ -1,5 +1,5 @@ const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') const Spa = math.type.Spa describe('Spa', function () { diff --git a/test/type/matrix/SparseMatrix.test.js b/test/type/matrix/SparseMatrix.test.js index af5ff5739..53b34346b 100644 --- a/test/type/matrix/SparseMatrix.test.js +++ b/test/type/matrix/SparseMatrix.test.js @@ -1,5 +1,5 @@ const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') const index = math.index const Matrix = math.type.Matrix const SparseMatrix = math.type.SparseMatrix diff --git a/test/type/matrix/collection.test.js b/test/type/matrix/collection.test.js index 4148b35ef..7f3999b47 100644 --- a/test/type/matrix/collection.test.js +++ b/test/type/matrix/collection.test.js @@ -1,6 +1,6 @@ const assert = require('assert') const isCollection = require('../../../src/utils/collection/isCollection') -const math = require('../../../src/index') +const math = require('../../../src/main') const DenseMatrix = math.type.DenseMatrix const SparseMatrix = math.type.SparseMatrix diff --git a/test/type/matrix/function/index.test.js b/test/type/matrix/function/index.test.js index 0db99b2c3..4b3ecd5e2 100644 --- a/test/type/matrix/function/index.test.js +++ b/test/type/matrix/function/index.test.js @@ -1,5 +1,5 @@ // test index construction -const assert = require('assert'), math = require('../../../../src/index'), Range = math.type.Range, ImmutableDenseMatrix = math.type.ImmutableDenseMatrix +const assert = require('assert'), math = require('../../../../src/main'), Range = math.type.Range, ImmutableDenseMatrix = math.type.ImmutableDenseMatrix describe('index', function () { it('should create an index', function () { diff --git a/test/type/matrix/function/matrix.test.js b/test/type/matrix/function/matrix.test.js index ac04021d1..96fc68934 100644 --- a/test/type/matrix/function/matrix.test.js +++ b/test/type/matrix/function/matrix.test.js @@ -1,5 +1,5 @@ // test matrix construction -const assert = require('assert'), math = require('../../../../src/index'), matrix = math.matrix +const assert = require('assert'), math = require('../../../../src/main'), matrix = math.matrix describe('matrix', function () { it('should create an empty matrix with one dimension if called without argument', function () { diff --git a/test/type/matrix/function/sparse.test.js b/test/type/matrix/function/sparse.test.js index 54ccaa5c5..3d55f8399 100644 --- a/test/type/matrix/function/sparse.test.js +++ b/test/type/matrix/function/sparse.test.js @@ -1,5 +1,5 @@ // test matrix construction -const assert = require('assert'), math = require('../../../../src/index'), sparse = math.sparse +const assert = require('assert'), math = require('../../../../src/main'), sparse = math.sparse describe('sparse', function () { it('should create empty matrix', function () { diff --git a/test/type/number.test.js b/test/type/number.test.js index b6f2ffc6e..36dbff9e2 100644 --- a/test/type/number.test.js +++ b/test/type/number.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), error = require('../../src/error/index'), math = require('../../src/index'), approx = require('../../tools/approx'), number = math.number +const assert = require('assert'), error = require('../../src/error/index'), math = require('../../src/main'), approx = require('../../tools/approx'), number = math.number describe('number', function () { it('should be 0 if called with no argument', function () { diff --git a/test/type/resultset/ResultSet.test.js b/test/type/resultset/ResultSet.test.js index f39684738..af5d883a4 100644 --- a/test/type/resultset/ResultSet.test.js +++ b/test/type/resultset/ResultSet.test.js @@ -1,7 +1,7 @@ // test data type ResultSet const assert = require('assert') -const math = require('../../../src/index') +const math = require('../../../src/main') const Unit = math.type.Unit const Complex = math.type.Complex const ResultSet = math.type.ResultSet diff --git a/test/type/string.test.js b/test/type/string.test.js index e29f34e4b..93ed4f3c4 100644 --- a/test/type/string.test.js +++ b/test/type/string.test.js @@ -1,4 +1,4 @@ -const assert = require('assert'), error = require('../../src/error/index'), math = require('../../src/index'), string = math.string +const assert = require('assert'), error = require('../../src/error/index'), math = require('../../src/main'), string = math.string describe('string', function () { it('should be \'\' if called with no argument', function () { diff --git a/test/type/unit/Unit.test.js b/test/type/unit/Unit.test.js index 4571fc4b3..621968093 100644 --- a/test/type/unit/Unit.test.js +++ b/test/type/unit/Unit.test.js @@ -1,6 +1,6 @@ const assert = require('assert') const approx = require('../../../tools/approx') -const math = require('../../../src/index') +const math = require('../../../src/main') const Unit = math.type.Unit describe('Unit', function () { diff --git a/test/type/unit/function/createUnit.test.js b/test/type/unit/function/createUnit.test.js index c9c58d2a4..d5a3f29c0 100644 --- a/test/type/unit/function/createUnit.test.js +++ b/test/type/unit/function/createUnit.test.js @@ -1,5 +1,5 @@ const assert = require('assert') -const math = require('../../../../src/index') +const math = require('../../../../src/main') const createUnit = math.createUnit const Unit = math.type.Unit diff --git a/test/type/unit/function/splitUnit.test.js b/test/type/unit/function/splitUnit.test.js index 3496b6597..86181fc0f 100644 --- a/test/type/unit/function/splitUnit.test.js +++ b/test/type/unit/function/splitUnit.test.js @@ -1,5 +1,5 @@ const assert = require('assert') -const math = require('../../../../src/index') +const math = require('../../../../src/main') const splitUnit = math.splitUnit const Unit = math.type.Unit diff --git a/test/type/unit/function/unit.test.js b/test/type/unit/function/unit.test.js index f577ac062..94532d48b 100644 --- a/test/type/unit/function/unit.test.js +++ b/test/type/unit/function/unit.test.js @@ -1,5 +1,5 @@ const assert = require('assert') -const math = require('../../../../src/index') +const math = require('../../../../src/main') const unit = math.unit const Unit = math.type.Unit diff --git a/test/type/unit/physicalConstants.test.js b/test/type/unit/physicalConstants.test.js index c0419df36..13b2e4e47 100644 --- a/test/type/unit/physicalConstants.test.js +++ b/test/type/unit/physicalConstants.test.js @@ -1,6 +1,6 @@ const assert = require('assert') const approx = require('../../../tools/approx') -const math = require('../../../src/index') +const math = require('../../../src/main') describe('physical constants', function () { it('should return the correct value and unit for physical constants', function () { diff --git a/test/utils/customs.test.js b/test/utils/customs.test.js index 5b4c1089c..a6709fa3d 100644 --- a/test/utils/customs.test.js +++ b/test/utils/customs.test.js @@ -2,7 +2,7 @@ const assert = require('assert') const approx = require('../../tools/approx') const customs = require('../../src/utils/customs') -const math = require('../../src/index') +const math = require('../../src/main') describe('customs', function () { describe('isSafeMethod', function () { diff --git a/test/utils/string.test.js b/test/utils/string.test.js index d5a756fad..b8060cdf1 100644 --- a/test/utils/string.test.js +++ b/test/utils/string.test.js @@ -2,7 +2,7 @@ const assert = require('assert') const approx = require('../../tools/approx') const BigNumber = require('decimal.js') -const math = require('../../src/index') +const math = require('../../src/main') const string = require('../../src/utils/string') describe('string', function () { diff --git a/tools/matrixmarket.js b/tools/matrixmarket.js index b1c408969..4c022e721 100644 --- a/tools/matrixmarket.js +++ b/tools/matrixmarket.js @@ -1,6 +1,6 @@ 'use strict' -const fs = require('fs'), zlib = require('zlib'), tar = require('tar'), math = require('../src/index'), Q = require('q'), typed = require('typed-function'), Spa = math.type.Spa, DenseMatrix = math.type.DenseMatrix, SparseMatrix = math.type.SparseMatrix, FibonacciHeap = math.type.FibonacciHeap +const fs = require('fs'), zlib = require('zlib'), tar = require('tar'), math = require('../src/main'), Q = require('q'), typed = require('typed-function'), Spa = math.type.Spa, DenseMatrix = math.type.DenseMatrix, SparseMatrix = math.type.SparseMatrix, FibonacciHeap = math.type.FibonacciHeap const _importFromStream = function (stream, deferred) { // header regex