diff --git a/src/function/set/setCartesian.js b/src/function/set/setCartesian.js index bc9db7c26..55eeb3f1f 100644 --- a/src/function/set/setCartesian.js +++ b/src/function/set/setCartesian.js @@ -3,7 +3,7 @@ const flatten = require('../../utils/array').flatten function factory (type, config, load, typed) { - const index = load(require('../../type/matrix/MatrixIndex')) + const MatrixIndex = load(require('../../type/matrix/MatrixIndex')) const matrix = load(require('../../type/matrix/DenseMatrix')) const size = load(require('../matrix/size')) const subset = load(require('../matrix/subset')) @@ -33,7 +33,7 @@ function factory (type, config, load, typed) { 'Array | Matrix, Array | Matrix': function (a1, a2) { let result = [] - if (subset(size(a1), new index(0)) !== 0 && subset(size(a2), new index(0)) !== 0) { // if any of them is empty, return empty + if (subset(size(a1), new MatrixIndex(0)) !== 0 && subset(size(a2), new MatrixIndex(0)) !== 0) { // if any of them is empty, return empty const b1 = flatten(Array.isArray(a1) ? a1 : a1.toArray()).sort(compareNatural) const b2 = flatten(Array.isArray(a2) ? a2 : a2.toArray()).sort(compareNatural) result = [] diff --git a/src/function/set/setDifference.js b/src/function/set/setDifference.js index ad5c5cf02..3eefd3124 100644 --- a/src/function/set/setDifference.js +++ b/src/function/set/setDifference.js @@ -5,7 +5,7 @@ const identify = require('../../utils/array').identify const generalize = require('../../utils/array').generalize function factory (type, config, load, typed) { - const index = load(require('../../type/matrix/MatrixIndex')) + const MatrixIndex = load(require('../../type/matrix/MatrixIndex')) const matrix = load(require('../../type/matrix/DenseMatrix')) const size = load(require('../matrix/size')) const subset = load(require('../matrix/subset')) @@ -35,9 +35,9 @@ function factory (type, config, load, typed) { const setDifference = typed('setDifference', { 'Array | Matrix, Array | Matrix': function (a1, a2) { let result - if (subset(size(a1), new index(0)) === 0) { // empty-anything=empty + if (subset(size(a1), new MatrixIndex(0)) === 0) { // empty-anything=empty result = [] - } else if (subset(size(a2), new index(0)) === 0) { // anything-empty=anything + } else if (subset(size(a2), new MatrixIndex(0)) === 0) { // anything-empty=anything return flatten(a1.toArray()) } else { const b1 = identify(flatten(Array.isArray(a1) ? a1 : a1.toArray()).sort(compareNatural)) diff --git a/src/function/set/setDistinct.js b/src/function/set/setDistinct.js index bb7ab3cf5..50576efbf 100644 --- a/src/function/set/setDistinct.js +++ b/src/function/set/setDistinct.js @@ -3,7 +3,7 @@ const flatten = require('../../utils/array').flatten function factory (type, config, load, typed) { - const index = load(require('../../type/matrix/MatrixIndex')) + const MatrixIndex = load(require('../../type/matrix/MatrixIndex')) const matrix = load(require('../../type/matrix/DenseMatrix')) const size = load(require('../matrix/size')) const subset = load(require('../matrix/subset')) @@ -31,7 +31,7 @@ function factory (type, config, load, typed) { const setDistinct = typed('setDistinct', { 'Array | Matrix': function (a) { let result - if (subset(size(a), new index(0)) === 0) { // if empty, return empty + if (subset(size(a), new MatrixIndex(0)) === 0) { // if empty, return empty result = [] } else { const b = flatten(Array.isArray(a) ? a : a.toArray()).sort(compareNatural) diff --git a/src/function/set/setIntersect.js b/src/function/set/setIntersect.js index fc812859c..3d8ed3c57 100644 --- a/src/function/set/setIntersect.js +++ b/src/function/set/setIntersect.js @@ -5,7 +5,7 @@ const identify = require('../../utils/array').identify const generalize = require('../../utils/array').generalize function factory (type, config, load, typed) { - const index = load(require('../../type/matrix/MatrixIndex')) + const MatrixIndex = load(require('../../type/matrix/MatrixIndex')) const matrix = load(require('../../type/matrix/DenseMatrix')) const size = load(require('../matrix/size')) const subset = load(require('../matrix/subset')) @@ -35,7 +35,7 @@ function factory (type, config, load, typed) { const setIntersect = typed('setIntersect', { 'Array | Matrix, Array | Matrix': function (a1, a2) { let result - if (subset(size(a1), new index(0)) === 0 || subset(size(a2), new index(0)) === 0) { // of any of them is empty, return empty + if (subset(size(a1), new MatrixIndex(0)) === 0 || subset(size(a2), new MatrixIndex(0)) === 0) { // of any of them is empty, return empty result = [] } else { const b1 = identify(flatten(Array.isArray(a1) ? a1 : a1.toArray()).sort(compareNatural)) diff --git a/src/function/set/setIsSubset.js b/src/function/set/setIsSubset.js index 4223d0806..2619808a2 100644 --- a/src/function/set/setIsSubset.js +++ b/src/function/set/setIsSubset.js @@ -4,7 +4,7 @@ const flatten = require('../../utils/array').flatten const identify = require('../../utils/array').identify function factory (type, config, load, typed) { - const index = load(require('../../type/matrix/MatrixIndex')) + const MatrixIndex = load(require('../../type/matrix/MatrixIndex')) const size = load(require('../matrix/size')) const subset = load(require('../matrix/subset')) const compareNatural = load(require('../relational/compareNatural')) @@ -32,9 +32,9 @@ function factory (type, config, load, typed) { */ const setIsSubset = typed('setIsSubset', { 'Array | Matrix, Array | Matrix': function (a1, a2) { - if (subset(size(a1), new index(0)) === 0) { // empty is a subset of anything + if (subset(size(a1), new MatrixIndex(0)) === 0) { // empty is a subset of anything return true - } else if (subset(size(a2), new index(0)) === 0) { // anything is not a subset of empty + } else if (subset(size(a2), new MatrixIndex(0)) === 0) { // anything is not a subset of empty return false } const b1 = identify(flatten(Array.isArray(a1) ? a1 : a1.toArray()).sort(compareNatural)) diff --git a/src/function/set/setMultiplicity.js b/src/function/set/setMultiplicity.js index 19fc4e83f..b48589340 100644 --- a/src/function/set/setMultiplicity.js +++ b/src/function/set/setMultiplicity.js @@ -4,7 +4,7 @@ const flatten = require('../../utils/array').flatten function factory (type, config, load, typed) { const compareNatural = load(require('../relational/compareNatural')) - const index = load(require('../../type/matrix/MatrixIndex')) + const MatrixIndex = load(require('../../type/matrix/MatrixIndex')) const size = load(require('../matrix/size')) const subset = load(require('../matrix/subset')) @@ -31,7 +31,7 @@ function factory (type, config, load, typed) { */ const setMultiplicity = typed('setMultiplicity', { 'number | BigNumber | Fraction | Complex, Array | Matrix': function (e, a) { - if (subset(size(a), new index(0)) === 0) { // if empty, return 0 + if (subset(size(a), new MatrixIndex(0)) === 0) { // if empty, return 0 return 0 } const b = flatten(Array.isArray(a) ? a : a.toArray()) diff --git a/src/function/set/setPowerset.js b/src/function/set/setPowerset.js index 3421f9cb6..e43874bf2 100644 --- a/src/function/set/setPowerset.js +++ b/src/function/set/setPowerset.js @@ -3,7 +3,7 @@ const flatten = require('../../utils/array').flatten function factory (type, config, load, typed) { - const index = load(require('../../type/matrix/MatrixIndex')) + const MatrixIndex = load(require('../../type/matrix/MatrixIndex')) const size = load(require('../matrix/size')) const subset = load(require('../matrix/subset')) const compareNatural = load(require('../relational/compareNatural')) @@ -29,7 +29,7 @@ function factory (type, config, load, typed) { */ const setPowerset = typed('setPowerset', { 'Array | Matrix': function (a) { - if (subset(size(a), new index(0)) === 0) { // if empty, return empty + if (subset(size(a), new MatrixIndex(0)) === 0) { // if empty, return empty return [] } const b = flatten(Array.isArray(a) ? a : a.toArray()).sort(compareNatural) diff --git a/src/function/set/setSymDifference.js b/src/function/set/setSymDifference.js index 256d4d03d..3aae2b602 100644 --- a/src/function/set/setSymDifference.js +++ b/src/function/set/setSymDifference.js @@ -3,7 +3,7 @@ const flatten = require('../../utils/array').flatten function factory (type, config, load, typed) { - const index = load(require('../../type/matrix/MatrixIndex')) + const MatrixIndex = load(require('../../type/matrix/MatrixIndex')) const concat = load(require('../matrix/concat')) const size = load(require('../matrix/size')) const subset = load(require('../matrix/subset')) @@ -32,9 +32,9 @@ function factory (type, config, load, typed) { */ const setSymDifference = typed('setSymDifference', { 'Array | Matrix, Array | Matrix': function (a1, a2) { - if (subset(size(a1), new index(0)) === 0) { // if any of them is empty, return the other one + if (subset(size(a1), new MatrixIndex(0)) === 0) { // if any of them is empty, return the other one return flatten(a2) - } else if (subset(size(a2), new index(0)) === 0) { + } else if (subset(size(a2), new MatrixIndex(0)) === 0) { return flatten(a1) } const b1 = flatten(a1) diff --git a/src/function/set/setUnion.js b/src/function/set/setUnion.js index eb7be7c73..1c89ba555 100644 --- a/src/function/set/setUnion.js +++ b/src/function/set/setUnion.js @@ -3,7 +3,7 @@ const flatten = require('../../utils/array').flatten function factory (type, config, load, typed) { - const index = load(require('../../type/matrix/MatrixIndex')) + const MatrixIndex = load(require('../../type/matrix/MatrixIndex')) const concat = load(require('../matrix/concat')) const size = load(require('../matrix/size')) const subset = load(require('../matrix/subset')) @@ -33,9 +33,9 @@ function factory (type, config, load, typed) { */ const setUnion = typed('setUnion', { 'Array | Matrix, Array | Matrix': function (a1, a2) { - if (subset(size(a1), new index(0)) === 0) { // if any of them is empty, return the other one + if (subset(size(a1), new MatrixIndex(0)) === 0) { // if any of them is empty, return the other one return flatten(a2) - } else if (subset(size(a2), new index(0)) === 0) { + } else if (subset(size(a2), new MatrixIndex(0)) === 0) { return flatten(a1) } const b1 = flatten(a1)